Minor refactoring of arne's timer bugfix

pull/14/head
Sam Bosley 12 years ago
parent a4bd31c5c4
commit 1b7732ea6a

@ -52,7 +52,7 @@ public class TimerPlugin extends BroadcastReceiver {
public static void updateTimer(Context context, Task task, boolean start) {
// if this call comes from tasklist, then we need to fill in the gaps to handle this correctly
// this is needed just for stopping a task
if (!start && (task.getValue(Task.TIMER_START) == 0))
if (!task.containsNonNullValue(Task.TIMER_START))
task = PluginServices.getTaskService().fetchById(task.getId(), Task.ID, Task.TIMER_START, Task.ELAPSED_SECONDS);
if(start) {

@ -1134,7 +1134,6 @@ public class TaskListFragment extends ListFragment implements OnScrollListener,
public void onClick(DialogInterface dialog, int which) {
onTaskDelete(task);
taskService.delete(task);
TimerPlugin.updateTimer(getActivity(), task, false);
loadTaskListContent(true);
}
}).setNegativeButton(android.R.string.cancel, null).show();
@ -1152,6 +1151,7 @@ public class TaskListFragment extends ListFragment implements OnScrollListener,
tef.discardButtonClick();
}
}
TimerPlugin.updateTimer(getActivity(), task, false);
}
public void incrementFilterCount() {

Loading…
Cancel
Save