1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-02 00:25:10 -04: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.resetVisibleLimits(account.getDisplayCount());
long newSize = localStore.getSize();
AccountStats stats = new AccountStats();
stats.size = newSize;
stats.unreadMessageCount = 0;
stats.flaggedMessageCount = 0;
if (ml != null)
{
ml.accountSizeChanged(account, oldSize, newSize);
ml.accountStatusChanged(account, stats);
}
for (MessagingListener l : getListeners())
{
l.accountSizeChanged(account, oldSize, newSize);
l.accountStatusChanged(account, stats);
}
}
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
// been deleted locally. They take up insignificant space
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();
if (K9.DEBUG)