1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 11:42:16 -05:00

stop trying to count messages in every folder for folder lists that don't display them

This commit is contained in:
Jesse Vincent 2008-11-01 22:48:57 +00:00
parent 79c140378d
commit 4eb607d781

View File

@ -736,6 +736,14 @@ public class FolderMessageList extends ExpandableListActivity {
holder.name = folder.getName(); holder.name = folder.getName();
if (holder.name.equalsIgnoreCase(k9.INBOX)) { if (holder.name.equalsIgnoreCase(k9.INBOX)) {
holder.displayName = getString(R.string.special_mailbox_name_inbox); holder.displayName = getString(R.string.special_mailbox_name_inbox);
// XXX TOOD nuke when we do this for all folders
try {
holder.unreadMessageCount = folder.getUnreadMessageCount();
}
catch (MessagingException me) {
Log.e(k9.LOG_TAG, "Folder.getUnreadMessageCount() failed", me);
}
} }
else { else {
holder.displayName = folder.getName(); holder.displayName = folder.getName();
@ -746,14 +754,18 @@ public class FolderMessageList extends ExpandableListActivity {
if (holder.messages == null) { if (holder.messages == null) {
holder.messages = new ArrayList<MessageInfoHolder>(); holder.messages = new ArrayList<MessageInfoHolder>();
} }
/* TODO - once we're in a position to asynchronously list off
* unread message counts quckly, start doing this again.
* right now, they're not even displayed
try { try {
folder.open(Folder.OpenMode.READ_WRITE);
holder.unreadMessageCount = folder.getUnreadMessageCount(); holder.unreadMessageCount = folder.getUnreadMessageCount();
folder.close(false);
} }
catch (MessagingException me) { catch (MessagingException me) {
Log.e(k9.LOG_TAG, "Folder.getUnreadMessageCount() failed", me); Log.e(k9.LOG_TAG, "Folder.getUnreadMessageCount() failed", me);
} }
*/
} }
Collections.sort(mFolders); Collections.sort(mFolders);
@ -775,7 +787,7 @@ public class FolderMessageList extends ExpandableListActivity {
/* /*
* Now we need to refresh any folders that are currently expanded. We do this * Now we need to refresh any folders that are currently expanded. We do this
* in case the status or amount of messages has changed. * in case the status or number of messages has changed.
*/ */
for (int i = 0, count = getGroupCount(); i < count; i++) { for (int i = 0, count = getGroupCount(); i < count; i++) {
if (mListView.isGroupExpanded(i)) { if (mListView.isGroupExpanded(i)) {