From c8bcad6a21ae3fc4efd50f4d587ee6137639e0a4 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Sun, 27 Dec 2009 16:51:06 +0000 Subject: [PATCH] Refactor and reverse logic to be a bit cleaner --- src/com/fsck/k9/activity/MessageList.java | 39 ++++++++++------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/src/com/fsck/k9/activity/MessageList.java b/src/com/fsck/k9/activity/MessageList.java index 9ce1e663e..057273307 100644 --- a/src/com/fsck/k9/activity/MessageList.java +++ b/src/com/fsck/k9/activity/MessageList.java @@ -1545,39 +1545,35 @@ public class MessageList @Override public void listLocalMessagesStarted(Account account, String folder) { - if (!account.equals(mAccount)) + if (account.equals(mAccount)) { - return; + mHandler.progress(true); + mHandler.folderLoading(folder, true); } - mHandler.progress(true); - mHandler.folderLoading(folder, true); } @Override public void listLocalMessagesFailed(Account account, String folder, String message) { - if (!account.equals(mAccount)) + if (account.equals(mAccount)) { - return; + mHandler.sortMessages(); + mHandler.progress(false); + mHandler.folderLoading(folder, false); } - mHandler.sortMessages(); - mHandler.progress(false); - mHandler.folderLoading(folder, false); } @Override public void listLocalMessagesFinished(Account account, String folder) { - if (!account.equals(mAccount)) + if (account.equals(mAccount)) { - return; + mHandler.sortMessages(); + mHandler.progress(false); + mHandler.folderLoading(folder, false); } - mHandler.sortMessages(); - - mHandler.progress(false); - mHandler.folderLoading(folder, false); } @Override @@ -1598,14 +1594,13 @@ public class MessageList @Override public void listLocalMessagesRemoveMessage(Account account, String folder,Message message) { - if (!account.equals(mAccount) || !folder.equals(mFolderName)) + if (account.equals(mAccount) && folder.equals(mFolderName)) { - return; - } - MessageInfoHolder holder = getMessage(message.getUid()); - if (holder != null) - { - removeMessage(getMessage(message.getUid())); + MessageInfoHolder holder = getMessage(message.getUid()); + if (holder != null) + { + removeMessage(getMessage(message.getUid())); + } } }