mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 11:42:16 -05:00
commit
29f7552c3a
@ -42,7 +42,7 @@ import com.fsck.k9.search.LocalSearch;
|
|||||||
import com.fsck.k9.search.SqlQueryBuilder;
|
import com.fsck.k9.search.SqlQueryBuilder;
|
||||||
import com.fsck.k9.search.SearchSpecification.Attribute;
|
import com.fsck.k9.search.SearchSpecification.Attribute;
|
||||||
import com.fsck.k9.search.SearchSpecification.SearchCondition;
|
import com.fsck.k9.search.SearchSpecification.SearchCondition;
|
||||||
import com.fsck.k9.search.SearchSpecification.Searchfield;
|
import com.fsck.k9.search.SearchSpecification.SearchField;
|
||||||
import com.fsck.k9.mail.ssl.LocalKeyStore;
|
import com.fsck.k9.mail.ssl.LocalKeyStore;
|
||||||
import com.fsck.k9.view.ColorChip;
|
import com.fsck.k9.view.ColorChip;
|
||||||
import com.larswerkman.colorpicker.ColorPicker;
|
import com.larswerkman.colorpicker.ColorPicker;
|
||||||
@ -1732,17 +1732,17 @@ public class Account implements BaseAccount, StoreConfig {
|
|||||||
switch (displayMode) {
|
switch (displayMode) {
|
||||||
case FIRST_CLASS: {
|
case FIRST_CLASS: {
|
||||||
// Count messages in the INBOX and non-special first class folders
|
// Count messages in the INBOX and non-special first class folders
|
||||||
search.and(Searchfield.DISPLAY_CLASS, FolderClass.FIRST_CLASS.name(),
|
search.and(SearchField.DISPLAY_CLASS, FolderClass.FIRST_CLASS.name(),
|
||||||
Attribute.EQUALS);
|
Attribute.EQUALS);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case FIRST_AND_SECOND_CLASS: {
|
case FIRST_AND_SECOND_CLASS: {
|
||||||
// Count messages in the INBOX and non-special first and second class folders
|
// Count messages in the INBOX and non-special first and second class folders
|
||||||
search.and(Searchfield.DISPLAY_CLASS, FolderClass.FIRST_CLASS.name(),
|
search.and(SearchField.DISPLAY_CLASS, FolderClass.FIRST_CLASS.name(),
|
||||||
Attribute.EQUALS);
|
Attribute.EQUALS);
|
||||||
|
|
||||||
// TODO: Create a proper interface for creating arbitrary condition trees
|
// TODO: Create a proper interface for creating arbitrary condition trees
|
||||||
SearchCondition searchCondition = new SearchCondition(Searchfield.DISPLAY_CLASS,
|
SearchCondition searchCondition = new SearchCondition(SearchField.DISPLAY_CLASS,
|
||||||
Attribute.EQUALS, FolderClass.SECOND_CLASS.name());
|
Attribute.EQUALS, FolderClass.SECOND_CLASS.name());
|
||||||
ConditionsTreeNode root = search.getConditions();
|
ConditionsTreeNode root = search.getConditions();
|
||||||
if (root.mRight != null) {
|
if (root.mRight != null) {
|
||||||
@ -1754,7 +1754,7 @@ public class Account implements BaseAccount, StoreConfig {
|
|||||||
}
|
}
|
||||||
case NOT_SECOND_CLASS: {
|
case NOT_SECOND_CLASS: {
|
||||||
// Count messages in the INBOX and non-special non-second-class folders
|
// Count messages in the INBOX and non-special non-second-class folders
|
||||||
search.and(Searchfield.DISPLAY_CLASS, FolderClass.SECOND_CLASS.name(),
|
search.and(SearchField.DISPLAY_CLASS, FolderClass.SECOND_CLASS.name(),
|
||||||
Attribute.NOT_EQUALS);
|
Attribute.NOT_EQUALS);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1792,7 +1792,7 @@ public class Account implements BaseAccount, StoreConfig {
|
|||||||
excludeSpecialFolder(search, getOutboxFolderName());
|
excludeSpecialFolder(search, getOutboxFolderName());
|
||||||
excludeSpecialFolder(search, getSentFolderName());
|
excludeSpecialFolder(search, getSentFolderName());
|
||||||
excludeSpecialFolder(search, getErrorFolderName());
|
excludeSpecialFolder(search, getErrorFolderName());
|
||||||
search.or(new SearchCondition(Searchfield.FOLDER, Attribute.EQUALS, getInboxFolderName()));
|
search.or(new SearchCondition(SearchField.FOLDER, Attribute.EQUALS, getInboxFolderName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1816,12 +1816,12 @@ public class Account implements BaseAccount, StoreConfig {
|
|||||||
excludeSpecialFolder(search, getTrashFolderName());
|
excludeSpecialFolder(search, getTrashFolderName());
|
||||||
excludeSpecialFolder(search, getSpamFolderName());
|
excludeSpecialFolder(search, getSpamFolderName());
|
||||||
excludeSpecialFolder(search, getOutboxFolderName());
|
excludeSpecialFolder(search, getOutboxFolderName());
|
||||||
search.or(new SearchCondition(Searchfield.FOLDER, Attribute.EQUALS, getInboxFolderName()));
|
search.or(new SearchCondition(SearchField.FOLDER, Attribute.EQUALS, getInboxFolderName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void excludeSpecialFolder(LocalSearch search, String folderName) {
|
private void excludeSpecialFolder(LocalSearch search, String folderName) {
|
||||||
if (!K9.FOLDER_NONE.equals(folderName)) {
|
if (!K9.FOLDER_NONE.equals(folderName)) {
|
||||||
search.and(Searchfield.FOLDER, folderName, Attribute.NOT_EQUALS);
|
search.and(SearchField.FOLDER, folderName, Attribute.NOT_EQUALS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ import com.fsck.k9.preferences.SettingsImporter.ImportResults;
|
|||||||
import com.fsck.k9.search.LocalSearch;
|
import com.fsck.k9.search.LocalSearch;
|
||||||
import com.fsck.k9.search.SearchAccount;
|
import com.fsck.k9.search.SearchAccount;
|
||||||
import com.fsck.k9.search.SearchSpecification.Attribute;
|
import com.fsck.k9.search.SearchSpecification.Attribute;
|
||||||
import com.fsck.k9.search.SearchSpecification.Searchfield;
|
import com.fsck.k9.search.SearchSpecification.SearchField;
|
||||||
import com.fsck.k9.view.ColorChip;
|
import com.fsck.k9.view.ColorChip;
|
||||||
|
|
||||||
import de.cketti.library.changelog.ChangeLog;
|
import de.cketti.library.changelog.ChangeLog;
|
||||||
@ -366,7 +366,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener {
|
|||||||
realAccount.limitToDisplayableFolders(search);
|
realAccount.limitToDisplayableFolders(search);
|
||||||
}
|
}
|
||||||
|
|
||||||
search.and(Searchfield.READ, "1", Attribute.NOT_EQUALS);
|
search.and(SearchField.READ, "1", Attribute.NOT_EQUALS);
|
||||||
|
|
||||||
return search;
|
return search;
|
||||||
}
|
}
|
||||||
@ -1864,7 +1864,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener {
|
|||||||
realAccount.limitToDisplayableFolders(search);
|
realAccount.limitToDisplayableFolders(search);
|
||||||
}
|
}
|
||||||
|
|
||||||
search.and(Searchfield.FLAGGED, "1", Attribute.EQUALS);
|
search.and(SearchField.FLAGGED, "1", Attribute.EQUALS);
|
||||||
|
|
||||||
return new AccountClickListener(search);
|
return new AccountClickListener(search);
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ import com.fsck.k9.mail.Message;
|
|||||||
import com.fsck.k9.mailstore.LocalFolder;
|
import com.fsck.k9.mailstore.LocalFolder;
|
||||||
import com.fsck.k9.search.LocalSearch;
|
import com.fsck.k9.search.LocalSearch;
|
||||||
import com.fsck.k9.search.SearchSpecification.Attribute;
|
import com.fsck.k9.search.SearchSpecification.Attribute;
|
||||||
import com.fsck.k9.search.SearchSpecification.Searchfield;
|
import com.fsck.k9.search.SearchSpecification.SearchField;
|
||||||
import com.fsck.k9.service.MailService;
|
import com.fsck.k9.service.MailService;
|
||||||
|
|
||||||
import de.cketti.library.changelog.ChangeLog;
|
import de.cketti.library.changelog.ChangeLog;
|
||||||
@ -1102,7 +1102,7 @@ public class FolderList extends K9ListActivity {
|
|||||||
getString(R.string.flagged_modifier));
|
getString(R.string.flagged_modifier));
|
||||||
|
|
||||||
LocalSearch search = new LocalSearch(searchTitle);
|
LocalSearch search = new LocalSearch(searchTitle);
|
||||||
search.and(Searchfield.FLAGGED, "1", Attribute.EQUALS);
|
search.and(SearchField.FLAGGED, "1", Attribute.EQUALS);
|
||||||
|
|
||||||
search.addAllowedFolder(folder.name);
|
search.addAllowedFolder(folder.name);
|
||||||
search.addAccountUuid(account.getUuid());
|
search.addAccountUuid(account.getUuid());
|
||||||
@ -1117,7 +1117,7 @@ public class FolderList extends K9ListActivity {
|
|||||||
getString(R.string.unread_modifier));
|
getString(R.string.unread_modifier));
|
||||||
|
|
||||||
LocalSearch search = new LocalSearch(searchTitle);
|
LocalSearch search = new LocalSearch(searchTitle);
|
||||||
search.and(Searchfield.READ, "1", Attribute.NOT_EQUALS);
|
search.and(SearchField.READ, "1", Attribute.NOT_EQUALS);
|
||||||
|
|
||||||
search.addAllowedFolder(folder.name);
|
search.addAllowedFolder(folder.name);
|
||||||
search.addAccountUuid(account.getUuid());
|
search.addAccountUuid(account.getUuid());
|
||||||
|
@ -49,7 +49,7 @@ import com.fsck.k9.search.SearchAccount;
|
|||||||
import com.fsck.k9.search.SearchSpecification;
|
import com.fsck.k9.search.SearchSpecification;
|
||||||
import com.fsck.k9.search.SearchSpecification.Attribute;
|
import com.fsck.k9.search.SearchSpecification.Attribute;
|
||||||
import com.fsck.k9.search.SearchSpecification.SearchCondition;
|
import com.fsck.k9.search.SearchSpecification.SearchCondition;
|
||||||
import com.fsck.k9.search.SearchSpecification.Searchfield;
|
import com.fsck.k9.search.SearchSpecification.SearchField;
|
||||||
import com.fsck.k9.view.MessageHeader;
|
import com.fsck.k9.view.MessageHeader;
|
||||||
import com.fsck.k9.view.MessageOpenPgpView;
|
import com.fsck.k9.view.MessageOpenPgpView;
|
||||||
import com.fsck.k9.view.MessageTitleView;
|
import com.fsck.k9.view.MessageTitleView;
|
||||||
@ -404,9 +404,9 @@ public class MessageList extends K9Activity implements MessageListFragmentListen
|
|||||||
mSearch.setManualSearch(true);
|
mSearch.setManualSearch(true);
|
||||||
mNoThreading = true;
|
mNoThreading = true;
|
||||||
|
|
||||||
mSearch.or(new SearchCondition(Searchfield.SENDER, Attribute.CONTAINS, query));
|
mSearch.or(new SearchCondition(SearchField.SENDER, Attribute.CONTAINS, query));
|
||||||
mSearch.or(new SearchCondition(Searchfield.SUBJECT, Attribute.CONTAINS, query));
|
mSearch.or(new SearchCondition(SearchField.SUBJECT, Attribute.CONTAINS, query));
|
||||||
mSearch.or(new SearchCondition(Searchfield.MESSAGE_CONTENTS, Attribute.CONTAINS, query));
|
mSearch.or(new SearchCondition(SearchField.MESSAGE_CONTENTS, Attribute.CONTAINS, query));
|
||||||
|
|
||||||
Bundle appData = intent.getBundleExtra(SearchManager.APP_DATA);
|
Bundle appData = intent.getBundleExtra(SearchManager.APP_DATA);
|
||||||
if (appData != null) {
|
if (appData != null) {
|
||||||
@ -1221,7 +1221,7 @@ public class MessageList extends K9Activity implements MessageListFragmentListen
|
|||||||
public void showMoreFromSameSender(String senderAddress) {
|
public void showMoreFromSameSender(String senderAddress) {
|
||||||
LocalSearch tmpSearch = new LocalSearch("From " + senderAddress);
|
LocalSearch tmpSearch = new LocalSearch("From " + senderAddress);
|
||||||
tmpSearch.addAccountUuids(mSearch.getAccountUuids());
|
tmpSearch.addAccountUuids(mSearch.getAccountUuids());
|
||||||
tmpSearch.and(Searchfield.SENDER, senderAddress, Attribute.CONTAINS);
|
tmpSearch.and(SearchField.SENDER, senderAddress, Attribute.CONTAINS);
|
||||||
|
|
||||||
MessageListFragment fragment = MessageListFragment.newInstance(tmpSearch, false, false);
|
MessageListFragment fragment = MessageListFragment.newInstance(tmpSearch, false, false);
|
||||||
|
|
||||||
@ -1310,7 +1310,7 @@ public class MessageList extends K9Activity implements MessageListFragmentListen
|
|||||||
|
|
||||||
LocalSearch tmpSearch = new LocalSearch();
|
LocalSearch tmpSearch = new LocalSearch();
|
||||||
tmpSearch.addAccountUuid(account.getUuid());
|
tmpSearch.addAccountUuid(account.getUuid());
|
||||||
tmpSearch.and(Searchfield.THREAD_ID, String.valueOf(threadRootId), Attribute.EQUALS);
|
tmpSearch.and(SearchField.THREAD_ID, String.valueOf(threadRootId), Attribute.EQUALS);
|
||||||
|
|
||||||
MessageListFragment fragment = MessageListFragment.newInstance(tmpSearch, true, false);
|
MessageListFragment fragment = MessageListFragment.newInstance(tmpSearch, true, false);
|
||||||
addMessageListFragment(fragment, true);
|
addMessageListFragment(fragment, true);
|
||||||
|
@ -99,7 +99,7 @@ import com.fsck.k9.search.ConditionsTreeNode;
|
|||||||
import com.fsck.k9.search.LocalSearch;
|
import com.fsck.k9.search.LocalSearch;
|
||||||
import com.fsck.k9.search.SearchSpecification;
|
import com.fsck.k9.search.SearchSpecification;
|
||||||
import com.fsck.k9.search.SearchSpecification.SearchCondition;
|
import com.fsck.k9.search.SearchSpecification.SearchCondition;
|
||||||
import com.fsck.k9.search.SearchSpecification.Searchfield;
|
import com.fsck.k9.search.SearchSpecification.SearchField;
|
||||||
import com.fsck.k9.search.SqlQueryBuilder;
|
import com.fsck.k9.search.SqlQueryBuilder;
|
||||||
|
|
||||||
import com.handmark.pulltorefresh.library.ILoadingLayout;
|
import com.handmark.pulltorefresh.library.ILoadingLayout;
|
||||||
@ -3360,7 +3360,7 @@ public class MessageListFragment extends Fragment implements OnItemClickListener
|
|||||||
private String getThreadId(LocalSearch search) {
|
private String getThreadId(LocalSearch search) {
|
||||||
for (ConditionsTreeNode node : search.getLeafSet()) {
|
for (ConditionsTreeNode node : search.getLeafSet()) {
|
||||||
SearchCondition condition = node.mCondition;
|
SearchCondition condition = node.mCondition;
|
||||||
if (condition.field == Searchfield.THREAD_ID) {
|
if (condition.field == SearchField.THREAD_ID) {
|
||||||
return condition.value;
|
return condition.value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,14 +22,13 @@ import com.fsck.k9.mail.MessageRetrievalListener;
|
|||||||
import com.fsck.k9.mail.MessagingException;
|
import com.fsck.k9.mail.MessagingException;
|
||||||
import com.fsck.k9.mail.Store;
|
import com.fsck.k9.mail.Store;
|
||||||
import com.fsck.k9.mailstore.StorageManager.StorageProvider;
|
import com.fsck.k9.mailstore.StorageManager.StorageProvider;
|
||||||
import com.fsck.k9.mail.store.StoreConfig;
|
|
||||||
import com.fsck.k9.mailstore.LockableDatabase.DbCallback;
|
import com.fsck.k9.mailstore.LockableDatabase.DbCallback;
|
||||||
import com.fsck.k9.mailstore.LockableDatabase.WrappedException;
|
import com.fsck.k9.mailstore.LockableDatabase.WrappedException;
|
||||||
import com.fsck.k9.provider.EmailProvider;
|
import com.fsck.k9.provider.EmailProvider;
|
||||||
import com.fsck.k9.provider.EmailProvider.MessageColumns;
|
import com.fsck.k9.provider.EmailProvider.MessageColumns;
|
||||||
import com.fsck.k9.search.LocalSearch;
|
import com.fsck.k9.search.LocalSearch;
|
||||||
import com.fsck.k9.search.SearchSpecification.Attribute;
|
import com.fsck.k9.search.SearchSpecification.Attribute;
|
||||||
import com.fsck.k9.search.SearchSpecification.Searchfield;
|
import com.fsck.k9.search.SearchSpecification.SearchField;
|
||||||
import com.fsck.k9.search.SqlQueryBuilder;
|
import com.fsck.k9.search.SqlQueryBuilder;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -671,7 +670,7 @@ public class LocalStore extends Store implements Serializable {
|
|||||||
String rootIdString = Long.toString(rootId);
|
String rootIdString = Long.toString(rootId);
|
||||||
|
|
||||||
LocalSearch search = new LocalSearch();
|
LocalSearch search = new LocalSearch();
|
||||||
search.and(Searchfield.THREAD_ID, rootIdString, Attribute.EQUALS);
|
search.and(SearchField.THREAD_ID, rootIdString, Attribute.EQUALS);
|
||||||
|
|
||||||
return searchForMessages(null, search);
|
return searchForMessages(null, search);
|
||||||
}
|
}
|
||||||
|
@ -11,8 +11,9 @@ import android.os.Parcel;
|
|||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
|
|
||||||
import com.fsck.k9.search.SearchSpecification.Attribute;
|
import com.fsck.k9.search.SearchSpecification.Attribute;
|
||||||
import com.fsck.k9.search.SearchSpecification.Searchfield;
|
|
||||||
import com.fsck.k9.search.SearchSpecification.SearchCondition;
|
import com.fsck.k9.search.SearchSpecification.SearchCondition;
|
||||||
|
import com.fsck.k9.search.SearchSpecification.SearchField;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class stores search conditions. It's basically a boolean expression binary tree.
|
* This class stores search conditions. It's basically a boolean expression binary tree.
|
||||||
@ -96,7 +97,7 @@ public class ConditionsTreeNode implements Parcelable {
|
|||||||
Operator tmpValue = ConditionsTreeNode.Operator.valueOf(cursor.getString(5));
|
Operator tmpValue = ConditionsTreeNode.Operator.valueOf(cursor.getString(5));
|
||||||
|
|
||||||
if (tmpValue == Operator.CONDITION) {
|
if (tmpValue == Operator.CONDITION) {
|
||||||
condition = new SearchCondition(Searchfield.valueOf(cursor.getString(0)),
|
condition = new SearchCondition(SearchField.valueOf(cursor.getString(0)),
|
||||||
Attribute.valueOf(cursor.getString(2)), cursor.getString(1));
|
Attribute.valueOf(cursor.getString(2)), cursor.getString(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ public class LocalSearch implements SearchSpecification {
|
|||||||
*
|
*
|
||||||
* @throws IllegalConditionException
|
* @throws IllegalConditionException
|
||||||
*/
|
*/
|
||||||
public void and(Searchfield field, String value, Attribute attribute) {
|
public void and(SearchField field, String value, Attribute attribute) {
|
||||||
and(new SearchCondition(field, attribute, value));
|
and(new SearchCondition(field, attribute, value));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -243,7 +243,7 @@ public class LocalSearch implements SearchSpecification {
|
|||||||
* - do and on root of it & rest of search
|
* - do and on root of it & rest of search
|
||||||
* - do or between folder nodes
|
* - do or between folder nodes
|
||||||
*/
|
*/
|
||||||
mConditions = and(new SearchCondition(Searchfield.FOLDER, Attribute.EQUALS, name));
|
mConditions = and(new SearchCondition(SearchField.FOLDER, Attribute.EQUALS, name));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -254,7 +254,7 @@ public class LocalSearch implements SearchSpecification {
|
|||||||
public List<String> getFolderNames() {
|
public List<String> getFolderNames() {
|
||||||
List<String> results = new ArrayList<String>();
|
List<String> results = new ArrayList<String>();
|
||||||
for (ConditionsTreeNode node : mLeafSet) {
|
for (ConditionsTreeNode node : mLeafSet) {
|
||||||
if (node.mCondition.field == Searchfield.FOLDER &&
|
if (node.mCondition.field == SearchField.FOLDER &&
|
||||||
node.mCondition.attribute == Attribute.EQUALS) {
|
node.mCondition.attribute == Attribute.EQUALS) {
|
||||||
results.add(node.mCondition.value);
|
results.add(node.mCondition.value);
|
||||||
}
|
}
|
||||||
@ -285,8 +285,8 @@ public class LocalSearch implements SearchSpecification {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (ConditionsTreeNode node : leafSet) {
|
for (ConditionsTreeNode node : leafSet) {
|
||||||
if (node.getCondition().field == Searchfield.SUBJECT ||
|
if (node.getCondition().field == SearchField.SUBJECT ||
|
||||||
node.getCondition().field == Searchfield.SENDER ) {
|
node.getCondition().field == SearchField.SENDER ) {
|
||||||
return node.getCondition().value;
|
return node.getCondition().value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,8 @@ import android.content.Context;
|
|||||||
import com.fsck.k9.BaseAccount;
|
import com.fsck.k9.BaseAccount;
|
||||||
import com.fsck.k9.R;
|
import com.fsck.k9.R;
|
||||||
import com.fsck.k9.search.SearchSpecification.Attribute;
|
import com.fsck.k9.search.SearchSpecification.Attribute;
|
||||||
import com.fsck.k9.search.SearchSpecification.Searchfield;
|
import com.fsck.k9.search.SearchSpecification.SearchField;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is basically a wrapper around a LocalSearch. It allows to expose it as
|
* This class is basically a wrapper around a LocalSearch. It allows to expose it as
|
||||||
@ -21,7 +22,7 @@ public class SearchAccount implements BaseAccount {
|
|||||||
String name = context.getString(R.string.search_all_messages_title);
|
String name = context.getString(R.string.search_all_messages_title);
|
||||||
|
|
||||||
LocalSearch tmpSearch = new LocalSearch(name);
|
LocalSearch tmpSearch = new LocalSearch(name);
|
||||||
tmpSearch.and(Searchfield.SEARCHABLE, "1", Attribute.EQUALS);
|
tmpSearch.and(SearchField.SEARCHABLE, "1", Attribute.EQUALS);
|
||||||
|
|
||||||
return new SearchAccount(ALL_MESSAGES, tmpSearch, name,
|
return new SearchAccount(ALL_MESSAGES, tmpSearch, name,
|
||||||
context.getString(R.string.search_all_messages_detail));
|
context.getString(R.string.search_all_messages_detail));
|
||||||
@ -32,7 +33,7 @@ public class SearchAccount implements BaseAccount {
|
|||||||
public static SearchAccount createUnifiedInboxAccount(Context context) {
|
public static SearchAccount createUnifiedInboxAccount(Context context) {
|
||||||
String name = context.getString(R.string.integrated_inbox_title);
|
String name = context.getString(R.string.integrated_inbox_title);
|
||||||
LocalSearch tmpSearch = new LocalSearch(name);
|
LocalSearch tmpSearch = new LocalSearch(name);
|
||||||
tmpSearch.and(Searchfield.INTEGRATE, "1", Attribute.EQUALS);
|
tmpSearch.and(SearchField.INTEGRATE, "1", Attribute.EQUALS);
|
||||||
return new SearchAccount(UNIFIED_INBOX, tmpSearch, name,
|
return new SearchAccount(UNIFIED_INBOX, tmpSearch, name,
|
||||||
context.getString(R.string.integrated_inbox_detail));
|
context.getString(R.string.integrated_inbox_detail));
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ public interface SearchSpecification extends Parcelable {
|
|||||||
* preview, mime_type
|
* preview, mime_type
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public enum Searchfield {
|
public enum SearchField {
|
||||||
SUBJECT,
|
SUBJECT,
|
||||||
DATE,
|
DATE,
|
||||||
UID,
|
UID,
|
||||||
@ -101,9 +101,9 @@ public interface SearchSpecification extends Parcelable {
|
|||||||
public class SearchCondition implements Parcelable {
|
public class SearchCondition implements Parcelable {
|
||||||
public final String value;
|
public final String value;
|
||||||
public final Attribute attribute;
|
public final Attribute attribute;
|
||||||
public final Searchfield field;
|
public final SearchField field;
|
||||||
|
|
||||||
public SearchCondition(Searchfield field, Attribute attribute, String value) {
|
public SearchCondition(SearchField field, Attribute attribute, String value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
this.attribute = attribute;
|
this.attribute = attribute;
|
||||||
this.field = field;
|
this.field = field;
|
||||||
@ -112,7 +112,7 @@ public interface SearchSpecification extends Parcelable {
|
|||||||
private SearchCondition(Parcel in) {
|
private SearchCondition(Parcel in) {
|
||||||
this.value = in.readString();
|
this.value = in.readString();
|
||||||
this.attribute = Attribute.values()[in.readInt()];
|
this.attribute = Attribute.values()[in.readInt()];
|
||||||
this.field = Searchfield.values()[in.readInt()];
|
this.field = SearchField.values()[in.readInt()];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -9,7 +9,7 @@ import com.fsck.k9.mailstore.LocalFolder;
|
|||||||
import com.fsck.k9.mailstore.LocalStore;
|
import com.fsck.k9.mailstore.LocalStore;
|
||||||
import com.fsck.k9.search.SearchSpecification.Attribute;
|
import com.fsck.k9.search.SearchSpecification.Attribute;
|
||||||
import com.fsck.k9.search.SearchSpecification.SearchCondition;
|
import com.fsck.k9.search.SearchSpecification.SearchCondition;
|
||||||
import com.fsck.k9.search.SearchSpecification.Searchfield;
|
import com.fsck.k9.search.SearchSpecification.SearchField;
|
||||||
|
|
||||||
|
|
||||||
public class SqlQueryBuilder {
|
public class SqlQueryBuilder {
|
||||||
@ -200,7 +200,7 @@ public class SqlQueryBuilder {
|
|||||||
private static void appendExprRight(SearchCondition condition, StringBuilder query,
|
private static void appendExprRight(SearchCondition condition, StringBuilder query,
|
||||||
List<String> selectionArgs) {
|
List<String> selectionArgs) {
|
||||||
String value = condition.value;
|
String value = condition.value;
|
||||||
Searchfield field = condition.field;
|
SearchField field = condition.field;
|
||||||
|
|
||||||
query.append(" ");
|
query.append(" ");
|
||||||
String selectionArg = null;
|
String selectionArg = null;
|
||||||
@ -256,7 +256,7 @@ public class SqlQueryBuilder {
|
|||||||
selectionArgs.add(selectionArg);
|
selectionArgs.add(selectionArg);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isNumberColumn(Searchfield field) {
|
private static boolean isNumberColumn(SearchField field) {
|
||||||
switch (field) {
|
switch (field) {
|
||||||
case ATTACHMENT_COUNT:
|
case ATTACHMENT_COUNT:
|
||||||
case DATE:
|
case DATE:
|
||||||
|
Loading…
Reference in New Issue
Block a user