mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-24 02:12:15 -05:00
Don't create folder -NONE- when excluding special folders from a search
This commit is contained in:
parent
ce0308f528
commit
f95e64f766
@ -1848,11 +1848,17 @@ public class Account implements BaseAccount {
|
|||||||
* The {@code LocalSearch} instance to modify.
|
* The {@code LocalSearch} instance to modify.
|
||||||
*/
|
*/
|
||||||
public void excludeSpecialFolders(LocalSearch search) {
|
public void excludeSpecialFolders(LocalSearch search) {
|
||||||
search.and(Searchfield.FOLDER, getTrashFolderName(), Attribute.NOT_EQUALS);
|
excludeSpecialFolder(search, getTrashFolderName());
|
||||||
search.and(Searchfield.FOLDER, getDraftsFolderName(), Attribute.NOT_EQUALS);
|
excludeSpecialFolder(search, getDraftsFolderName());
|
||||||
search.and(Searchfield.FOLDER, getSpamFolderName(), Attribute.NOT_EQUALS);
|
excludeSpecialFolder(search, getSpamFolderName());
|
||||||
search.and(Searchfield.FOLDER, getOutboxFolderName(), Attribute.NOT_EQUALS);
|
excludeSpecialFolder(search, getOutboxFolderName());
|
||||||
search.and(Searchfield.FOLDER, getSentFolderName(), Attribute.NOT_EQUALS);
|
excludeSpecialFolder(search, getSentFolderName());
|
||||||
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) {
|
||||||
|
if (!K9.FOLDER_NONE.equals(folderName)) {
|
||||||
|
search.and(Searchfield.FOLDER, folderName, Attribute.NOT_EQUALS);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user