1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-24 10:22:15 -05:00

Fixes Issue 1048

Zero out unread and flagged counts on all folders in an account being
cleared.
This commit is contained in:
Daniel Applebaum 2010-05-02 05:37:48 +00:00
parent 6e9145f037
commit 989e89f5b0
2 changed files with 7 additions and 0 deletions

View File

@ -4355,13 +4355,19 @@ public class MessagingController implements Runnable
localStore.clear(); localStore.clear();
localStore.resetVisibleLimits(account.getDisplayCount()); localStore.resetVisibleLimits(account.getDisplayCount());
long newSize = localStore.getSize(); long newSize = localStore.getSize();
AccountStats stats = new AccountStats();
stats.size = newSize;
stats.unreadMessageCount = 0;
stats.flaggedMessageCount = 0;
if (ml != null) if (ml != null)
{ {
ml.accountSizeChanged(account, oldSize, newSize); ml.accountSizeChanged(account, oldSize, newSize);
ml.accountStatusChanged(account, stats);
} }
for (MessagingListener l : getListeners()) for (MessagingListener l : getListeners())
{ {
l.accountSizeChanged(account, oldSize, newSize); l.accountSizeChanged(account, oldSize, newSize);
l.accountStatusChanged(account, stats);
} }
} }
catch (Exception e) catch (Exception e)

View File

@ -309,6 +309,7 @@ public class LocalStore extends Store implements Serializable
// Don't delete deleted messages. They are essentially placeholders for UIDs of messages that have // Don't delete deleted messages. They are essentially placeholders for UIDs of messages that have
// been deleted locally. They take up insignificant space // been deleted locally. They take up insignificant space
mDb.execSQL("DELETE FROM messages WHERE deleted = 0 and uid not like 'Local%'"); mDb.execSQL("DELETE FROM messages WHERE deleted = 0 and uid not like 'Local%'");
mDb.execSQL("update folders set flagged_count = 0, unread_count = 0");
compact(); compact();
if (K9.DEBUG) if (K9.DEBUG)