From f01f2f15cde94825288db6cd6fe9f314b0c47ab1 Mon Sep 17 00:00:00 2001 From: Sander Bogaert Date: Sat, 13 Oct 2012 14:19:50 -0400 Subject: [PATCH] Add static methods to create unifiedInbox and allMessages accounts. --- src/com/fsck/k9/search/SearchAccount.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/com/fsck/k9/search/SearchAccount.java b/src/com/fsck/k9/search/SearchAccount.java index d58c62de1..d76a8a0dd 100644 --- a/src/com/fsck/k9/search/SearchAccount.java +++ b/src/com/fsck/k9/search/SearchAccount.java @@ -2,7 +2,10 @@ package com.fsck.k9.search; import java.util.UUID; +import android.content.Context; + import com.fsck.k9.BaseAccount; +import com.fsck.k9.R; /** * This class is basically a wrapper around a LocalSearch. It allows to expose it as @@ -10,6 +13,24 @@ import com.fsck.k9.BaseAccount; */ public class SearchAccount implements BaseAccount { + // create the all messages search ( all accounts is default when none specified ) + public static SearchAccount createAllMessagesAccount(Context context) { + String name = context.getString(R.string.search_all_messages_title); + LocalSearch tmpSearch = new LocalSearch(name); + return new SearchAccount(tmpSearch, name, + context.getString(R.string.search_all_messages_detail)); + } + + + // create the unified inbox meta account ( all accounts is default when none specified ) + public static SearchAccount createUnifiedInboxAccount(Context context) { + String name = context.getString(R.string.integrated_inbox_title); + LocalSearch tmpSearch = new LocalSearch(name); + tmpSearch.addAllowedFolder(SearchSpecification.GENERIC_INBOX_NAME); + return new SearchAccount(tmpSearch, name, + context.getString(R.string.integrated_inbox_detail)); + } + private String mEmail = null; private String mDescription = null; private LocalSearch mSearch = null;