Skip to content

Commit

Permalink
No more of this crazy custom filter nonsense when assigning a task
Browse files Browse the repository at this point in the history
  • Loading branch information
sbosley committed Sep 18, 2012
1 parent a9c5279 commit 4d520c1
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions astrid/src/com/todoroo/astrid/activity/TaskListFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
import com.todoroo.astrid.core.CustomFilterActivity;
import com.todoroo.astrid.core.SortHelper;
import com.todoroo.astrid.dao.Database;
import com.todoroo.astrid.dao.TaskDao.TaskCriteria;
import com.todoroo.astrid.data.Metadata;
import com.todoroo.astrid.data.TagData;
import com.todoroo.astrid.data.Task;
Expand Down Expand Up @@ -973,7 +972,6 @@ public Filter getFilter() {
*
* @param withCustomId
*/
@SuppressWarnings("nls")
public void selectCustomId(long withCustomId) {
// if already in the list, select it
TodorooCursor<Task> currentCursor = (TodorooCursor<Task>) taskAdapter.getCursor();
Expand All @@ -984,33 +982,6 @@ public void selectCustomId(long withCustomId) {
return;
}
}

// create a custom cursor
if (!sqlQueryTemplate.get().contains("WHERE"))
sqlQueryTemplate.set(sqlQueryTemplate.get() + " WHERE "
+ TaskCriteria.byId(withCustomId));
else
sqlQueryTemplate.set(sqlQueryTemplate.get().replace("WHERE ",
"WHERE " + TaskCriteria.byId(withCustomId) + " OR "));

currentCursor = taskService.fetchFiltered(sqlQueryTemplate.get(), null,
taskProperties());
getListView().setFilterText("");

taskAdapter.changeCursor(currentCursor);

// update title
if (getActivity() instanceof TaskListActivity)
((TaskListActivity) getActivity()).setListsTitle(getString(R.string.TLA_custom));

// try selecting again
for (int i = 0; i < currentCursor.getCount(); i++) {
currentCursor.moveToPosition(i);
if (currentCursor.get(Task.ID) == withCustomId) {
getListView().setSelection(i);
break;
}
}
}

private void showTaskCreateHelpPopover() {
Expand Down

0 comments on commit 4d520c1

Please sign in to comment.