Fix for details loader causing double-send of tasks. Also stopping the details loading when you don't show notes

pull/14/head
Tim Su 13 years ago
parent fa79f5cbf6
commit f0c1221b57

@ -53,6 +53,7 @@ import com.todoroo.astrid.data.MetadataApiDao.MetadataCriteria;
import com.todoroo.astrid.data.RemoteModel;
import com.todoroo.astrid.data.TagData;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.data.TaskApiDao;
import com.todoroo.astrid.data.Update;
import com.todoroo.astrid.service.MetadataService;
import com.todoroo.astrid.service.StatisticsConstants;
@ -122,7 +123,8 @@ public final class ActFmSyncService {
if (actFmPreferenceService.isOngoing() && model.getTransitory("task-edit-save") == null)
return;
final ContentValues setValues = model.getSetValues();
if(setValues == null || !checkForToken() || setValues.containsKey(RemoteModel.REMOTE_ID_PROPERTY_NAME))
if(setValues == null || !checkForToken() ||
setValues.containsKey(RemoteModel.REMOTE_ID_PROPERTY_NAME))
return;
if(completedRepeatingTask(model))
return;
@ -311,6 +313,8 @@ public final class ActFmSyncService {
if(task.getValue(Task.TITLE).equals(title))
return;
}
if(TaskApiDao.insignificantChange(values))
return;
values = task.getMergedValues();
}

@ -213,10 +213,7 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
this.minRowHeight = (int) (57 * displayMetrics.density);
if (Preferences.getBoolean(R.string.p_showNotes, false)) {
detailLoader = new DetailLoaderThread();
detailLoader.start();
}
startDetailThread();
decorationManager = new DecorationManager();
@ -226,6 +223,13 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
}
private void startDetailThread() {
if (Preferences.getBoolean(R.string.p_showNotes, false)) {
detailLoader = new DetailLoaderThread();
detailLoader.start();
}
}
/* ======================================================================
* =========================================================== filterable
* ====================================================================== */
@ -792,8 +796,7 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
decorationManager.clearCache();
taskDetailLoader.clear();
taskActionLoader.clear();
detailLoader = new DetailLoaderThread();
detailLoader.start();
startDetailThread();
}
/**

Loading…
Cancel
Save