From 50b2056454c17ce1484d8ba99451ffe5de91508b Mon Sep 17 00:00:00 2001 From: Andrew Chen Date: Fri, 6 Apr 2012 16:46:04 -0700 Subject: [PATCH] Always hide the batch archive button in a search view, consistent with the batch ops menu. --- src/com/fsck/k9/activity/MessageList.java | 25 +++-------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/src/com/fsck/k9/activity/MessageList.java b/src/com/fsck/k9/activity/MessageList.java index d69d2ee55..822d6186b 100644 --- a/src/com/fsck/k9/activity/MessageList.java +++ b/src/com/fsck/k9/activity/MessageList.java @@ -827,12 +827,11 @@ public class MessageList mController.addListener(mAdapter.mListener); - final Preferences preferences = Preferences.getPreferences(this); - Account[] accountsWithNotification; if (mAccount != null) { accountsWithNotification = new Account[] { mAccount }; } else { + Preferences preferences = Preferences.getPreferences(this); accountsWithNotification = preferences.getAccounts(); } @@ -849,26 +848,8 @@ public class MessageList } } else if (mQueryString != null) { mController.searchLocalMessages(mAccountUuids, mFolderNames, null, mQueryString, mIntegrate, mQueryFlags, mForbiddenFlags, mAdapter.mListener); - boolean hasArchiveFolder = false; - if(mAccountUuids == null) { - for (final Account acct : preferences.getAccounts()) { - if (acct != null && acct.hasArchiveFolder()) { - hasArchiveFolder = true; - break; - } - } - } else { - for (final String accountUuid : mAccountUuids) { - final Account acct = preferences.getAccount(accountUuid); - if (acct != null && acct.hasArchiveFolder()) { - hasArchiveFolder = true; - break; - } - } - } - if (!hasArchiveFolder) { - mBatchArchiveButton.setVisibility(View.GONE); - } + // Don't show the archive button if this is a search. + mBatchArchiveButton.setVisibility(View.GONE); } } else {