diff --git a/app/src/main/java/com/todoroo/astrid/service/TaskDeleter.java b/app/src/main/java/com/todoroo/astrid/service/TaskDeleter.java index 3447b819d..4b3ce535a 100644 --- a/app/src/main/java/com/todoroo/astrid/service/TaskDeleter.java +++ b/app/src/main/java/com/todoroo/astrid/service/TaskDeleter.java @@ -1,6 +1,7 @@ package com.todoroo.astrid.service; import static org.tasks.db.DbUtils.collect; +import static org.tasks.db.QueryUtils.removeOrder; import static org.tasks.db.QueryUtils.showHiddenAndCompleted; import com.google.common.collect.ImmutableList; @@ -87,7 +88,8 @@ public class TaskDeleter { public int clearCompleted(Filter filter) { List completed = new ArrayList<>(); Filter deleteFilter = new Filter(null, null); - deleteFilter.setFilterQueryOverride(showHiddenAndCompleted(filter.getOriginalSqlQuery())); + deleteFilter.setFilterQueryOverride( + removeOrder(showHiddenAndCompleted(filter.getOriginalSqlQuery()))); List tasks = taskDao.fetchTasks( (includeGoogleSubtasks, includeCaldavSubtasks) -> diff --git a/app/src/main/java/org/tasks/db/QueryUtils.java b/app/src/main/java/org/tasks/db/QueryUtils.java index 34f89bb73..66cb58827 100644 --- a/app/src/main/java/org/tasks/db/QueryUtils.java +++ b/app/src/main/java/org/tasks/db/QueryUtils.java @@ -12,6 +12,9 @@ public class QueryUtils { private static final Pattern UNCOMPLETED = Pattern.compile("tasks\\.completed