1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-26 01:28:50 -05:00

Missed a case for stats computation

This commit is contained in:
Jesse Vincent 2011-01-17 03:22:30 +00:00
parent 30fed01784
commit 890564b926

View File

@ -586,7 +586,7 @@ public class LocalStore extends Store implements Serializable
Cursor cursor = null; Cursor cursor = null;
try try
{ {
String baseQuery = "SELECT SUM(unread_count), SUM(flagged_count) FROM FOLDERS WHERE name = ?"; String baseQuery = "SELECT SUM(unread_count), SUM(flagged_count) FROM folders";
if (displayMode == Account.FolderMode.NONE) if (displayMode == Account.FolderMode.NONE)
@ -595,17 +595,21 @@ public class LocalStore extends Store implements Serializable
} }
else if (displayMode == Account.FolderMode.FIRST_CLASS ) else if (displayMode == Account.FolderMode.FIRST_CLASS )
{ {
cursor = db.rawQuery(baseQuery + " OR display_class = ?", new String[] { K9.INBOX, Folder.FolderClass.FIRST_CLASS.name()}); cursor = db.rawQuery(baseQuery + " WHERE name = ? OR display_class = ?", new String[] { K9.INBOX, Folder.FolderClass.FIRST_CLASS.name()});
} }
else if (displayMode == Account.FolderMode.FIRST_AND_SECOND_CLASS) else if (displayMode == Account.FolderMode.FIRST_AND_SECOND_CLASS)
{ {
cursor = db.rawQuery(baseQuery + " OR display_class = ? OR display_class = ? ", new String[] { K9.INBOX, Folder.FolderClass.FIRST_CLASS.name(), Folder.FolderClass.SECOND_CLASS.name()}); cursor = db.rawQuery(baseQuery + " WHERE name = ? OR display_class = ? OR display_class = ? ", new String[] { K9.INBOX, Folder.FolderClass.FIRST_CLASS.name(), Folder.FolderClass.SECOND_CLASS.name()});
} }
else if (displayMode == Account.FolderMode.NOT_SECOND_CLASS) else if (displayMode == Account.FolderMode.NOT_SECOND_CLASS)
{ {
cursor = db.rawQuery(baseQuery + " OR display_class != ?", new String[] { K9.INBOX, Folder.FolderClass.SECOND_CLASS.name()}); cursor = db.rawQuery(baseQuery + " WHERE name = ? OR display_class != ?", new String[] { K9.INBOX, Folder.FolderClass.SECOND_CLASS.name()});
}
else if (displayMode == Account.FolderMode.ALL)
{
cursor = db.rawQuery(baseQuery, new String[] { });
} }
else else
{ {