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

Should retrieve just visibleLimit messages when the local folder is cleared.

This commit is contained in:
Koji Arai 2011-02-19 23:10:51 +09:00
parent cb46f170cd
commit b4f3712246
2 changed files with 2 additions and 7 deletions

View File

@ -793,7 +793,7 @@ public class MessagingController implements Runnable {
LocalStore localStore = account.getLocalStore();
LocalFolder localFolder = localStore.getFolder(folder);
if (localFolder.getVisibleLimit() > 0) {
localFolder.setVisibleLimit(localFolder.getVisibleLimit() + account.getDisplayCount());
localFolder.setVisibleLimit(localFolder.getVisibleLimit() + localFolder.getMessageCount());
}
synchronizeMailbox(account, folder, listener, null);
} catch (MessagingException me) {

View File

@ -485,9 +485,6 @@ public class LocalStore extends Store implements Serializable {
cursor = db.rawQuery("SELECT COUNT(*) FROM messages", null);
cursor.moveToFirst();
return cursor.getInt(0); // message count
} finally {
if (cursor != null) {
cursor.close();
@ -497,8 +494,6 @@ public class LocalStore extends Store implements Serializable {
});
}
public void getMessageCounts(final AccountStats stats) throws MessagingException {
final Account.FolderMode displayMode = mAccount.getFolderDisplayMode();
@ -1269,7 +1264,7 @@ public class LocalStore extends Store implements Serializable {
}
Cursor cursor = null;
try {
cursor = db.rawQuery("SELECT COUNT(*) FROM messages WHERE folder_id = ?",
cursor = db.rawQuery("SELECT COUNT(*) FROM messages WHERE deleted = 0 and folder_id = ?",
new String[] {
Long.toString(mFolderId)
});