From a4585657d115f46e506cbdb73643c01933b83408 Mon Sep 17 00:00:00 2001 From: cketti Date: Wed, 24 Oct 2012 06:57:14 +0200 Subject: [PATCH] Fix global search --- src/com/fsck/k9/activity/MessageList.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/com/fsck/k9/activity/MessageList.java b/src/com/fsck/k9/activity/MessageList.java index 67f065da8..92ab7d2e4 100644 --- a/src/com/fsck/k9/activity/MessageList.java +++ b/src/com/fsck/k9/activity/MessageList.java @@ -140,17 +140,22 @@ public class MessageList extends K9FragmentActivity implements MessageListFragme if (intent.getStringExtra(SearchManager.QUERY) != null) { if (Intent.ACTION_SEARCH.equals(intent.getAction())) { //Query was received from Search Dialog + String query = intent.getStringExtra(SearchManager.QUERY); + + mSearch = new LocalSearch(getString(R.string.search_results)); + mNoThreading = true; + + mSearch.or(new SearchCondition(Searchfield.SENDER, Attribute.CONTAINS, query)); + mSearch.or(new SearchCondition(Searchfield.SUBJECT, Attribute.CONTAINS, query)); + Bundle appData = getIntent().getBundleExtra(SearchManager.APP_DATA); if (appData != null) { - mSearch = new LocalSearch(); mSearch.addAccountUuid(appData.getString(EXTRA_SEARCH_ACCOUNT)); mSearch.addAllowedFolder(appData.getString(EXTRA_SEARCH_FOLDER)); - String query = intent.getStringExtra(SearchManager.QUERY); - mSearch.or(new SearchCondition(Searchfield.SENDER, Attribute.CONTAINS, query)); - mSearch.or(new SearchCondition(Searchfield.SUBJECT, Attribute.CONTAINS, query)); - mIsRemote = true; + } else { + mSearch.addAccountUuid(LocalSearch.ALL_ACCOUNTS); } } } else {