1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-30 13:12:25 -05:00

Always hide the batch archive button in a search view, consistent with the batch ops menu.

This commit is contained in:
Andrew Chen 2012-04-06 16:46:04 -07:00
parent 3559618ca9
commit 50b2056454

View File

@ -827,12 +827,11 @@ public class MessageList
mController.addListener(mAdapter.mListener); mController.addListener(mAdapter.mListener);
final Preferences preferences = Preferences.getPreferences(this);
Account[] accountsWithNotification; Account[] accountsWithNotification;
if (mAccount != null) { if (mAccount != null) {
accountsWithNotification = new Account[] { mAccount }; accountsWithNotification = new Account[] { mAccount };
} else { } else {
Preferences preferences = Preferences.getPreferences(this);
accountsWithNotification = preferences.getAccounts(); accountsWithNotification = preferences.getAccounts();
} }
@ -849,26 +848,8 @@ public class MessageList
} }
} else if (mQueryString != null) { } else if (mQueryString != null) {
mController.searchLocalMessages(mAccountUuids, mFolderNames, null, mQueryString, mIntegrate, mQueryFlags, mForbiddenFlags, mAdapter.mListener); mController.searchLocalMessages(mAccountUuids, mFolderNames, null, mQueryString, mIntegrate, mQueryFlags, mForbiddenFlags, mAdapter.mListener);
boolean hasArchiveFolder = false; // Don't show the archive button if this is a search.
if(mAccountUuids == null) { mBatchArchiveButton.setVisibility(View.GONE);
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);
}
} }
} else { } else {