From cacf039ac961da3be639be47da924c131ea6cd47 Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Fri, 4 Nov 2016 17:31:25 -0500 Subject: [PATCH] Exclude deleted tasks from search results --- .../astrid/activity/TaskListFragment.java | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/todoroo/astrid/activity/TaskListFragment.java b/src/main/java/com/todoroo/astrid/activity/TaskListFragment.java index 570c7ad02..457ef270b 100644 --- a/src/main/java/com/todoroo/astrid/activity/TaskListFragment.java +++ b/src/main/java/com/todoroo/astrid/activity/TaskListFragment.java @@ -257,20 +257,11 @@ public class TaskListFragment extends InjectingFragment implements query = query.trim(); String title = getString(R.string.FLA_search_filter, query); Filter savedFilter = new Filter(title, - new QueryTemplate().where - (Criterion.or(Task.NOTES. - like( - "%" + //$NON-NLS-1$ - query + "%" - ), - Task.TITLE. - like( - "%" + //$NON-NLS-1$ - query + "%" - ) - ) - )); - + new QueryTemplate().where(Criterion.and( + Task.DELETION_DATE.eq(0), + Criterion.or( + Task.NOTES.like("%" + query + "%"), + Task.TITLE.like("%" + query + "%"))))); ((TaskListActivity) getActivity()).onFilterItemClicked(savedFilter); MenuItemCompat.collapseActionView(item); return true;