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

simplify our "should we count messages in this folder" logic for the

purposes of account stats generation
This commit is contained in:
Jesse Vincent 2011-01-16 21:33:43 +00:00
parent 76e1165fea
commit c5846b4202

View File

@ -654,39 +654,33 @@ public class Account implements BaseAccount
Folder.FolderClass fMode = localFolder.getDisplayClass(); Folder.FolderClass fMode = localFolder.getDisplayClass();
// Always get stats about the INBOX (see issue 1817) // Always get stats about the INBOX (see issue 1817)
if (folder.getName().equals(K9.INBOX) || ( if (!folder.getName().equals(K9.INBOX) && isSpecialFolder(folder.getName()) )
!folder.getName().equals(getTrashFolderName()) &&
!folder.getName().equals(getDraftsFolderName()) &&
!folder.getName().equals(getArchiveFolderName()) &&
!folder.getName().equals(getSpamFolderName()) &&
!folder.getName().equals(getOutboxFolderName()) &&
!folder.getName().equals(getSentFolderName()) &&
!folder.getName().equals(getErrorFolderName())))
{ {
if (aMode == Account.FolderMode.NONE) continue;
{
continue;
}
if (aMode == Account.FolderMode.FIRST_CLASS &&
fMode != Folder.FolderClass.FIRST_CLASS)
{
continue;
}
if (aMode == Account.FolderMode.FIRST_AND_SECOND_CLASS &&
fMode != Folder.FolderClass.FIRST_CLASS &&
fMode != Folder.FolderClass.SECOND_CLASS)
{
continue;
}
if (aMode == Account.FolderMode.NOT_SECOND_CLASS &&
fMode == Folder.FolderClass.SECOND_CLASS)
{
continue;
}
unreadMessageCount += folder.getUnreadMessageCount();
flaggedMessageCount += folder.getFlaggedMessageCount();
} }
if (aMode == Account.FolderMode.NONE)
{
continue;
}
if (aMode == Account.FolderMode.FIRST_CLASS &&
fMode != Folder.FolderClass.FIRST_CLASS)
{
continue;
}
if (aMode == Account.FolderMode.FIRST_AND_SECOND_CLASS &&
fMode != Folder.FolderClass.FIRST_CLASS &&
fMode != Folder.FolderClass.SECOND_CLASS)
{
continue;
}
if (aMode == Account.FolderMode.NOT_SECOND_CLASS &&
fMode == Folder.FolderClass.SECOND_CLASS)
{
continue;
}
unreadMessageCount += folder.getUnreadMessageCount();
flaggedMessageCount += folder.getFlaggedMessageCount();
} }
long folderEvalEnd = System.currentTimeMillis(); long folderEvalEnd = System.currentTimeMillis();
stats.unreadMessageCount = unreadMessageCount; stats.unreadMessageCount = unreadMessageCount;