diff --git a/src/com/timsu/astrid/sync/SynchronizationProvider.java b/src/com/timsu/astrid/sync/SynchronizationProvider.java index d0e56703a..b75f74861 100644 --- a/src/com/timsu/astrid/sync/SynchronizationProvider.java +++ b/src/com/timsu/astrid/sync/SynchronizationProvider.java @@ -428,8 +428,8 @@ public abstract class SynchronizationProvider { taskController.saveTask(task, true); // save tags + LinkedList taskTags = tagController.getTaskTags(task.getTaskIdentifier()); if(remoteTask.tags != null) { - LinkedList taskTags = tagController.getTaskTags(task.getTaskIdentifier()); HashSet tagsToAdd = new HashSet(); for(String tag : remoteTask.tags) { String tagLower = tag.toLowerCase(); @@ -449,6 +449,11 @@ public abstract class SynchronizationProvider { tagController.removeTag(task.getTaskIdentifier(), tagId); for(TagIdentifier tagId : tagsToAdd) tagController.addTag(task.getTaskIdentifier(), tagId); + } else { + // remove existing tags + for(TagIdentifier tagId : taskTags) { + tagController.removeTag(task.getTaskIdentifier(), tagId); + } } stats.localUpdatedTasks++; diff --git a/src/com/timsu/astrid/sync/TaskProxy.java b/src/com/timsu/astrid/sync/TaskProxy.java index b0ed14167..cacdc4c1a 100644 --- a/src/com/timsu/astrid/sync/TaskProxy.java +++ b/src/com/timsu/astrid/sync/TaskProxy.java @@ -171,6 +171,8 @@ public class TaskProxy { task.setName(name); if(notes != null) task.setNotes(notes); + else + task.setNotes(""); if(importance != null) task.setImportance(importance); if(progressPercentage != null) @@ -192,20 +194,19 @@ public class TaskProxy { else task.setDefiniteDueDate(dueDate); } else { - if(definiteDueDate != null) - task.setDefiniteDueDate(definiteDueDate); - if(preferredDueDate != null) - task.setPreferredDueDate(preferredDueDate); + task.setDefiniteDueDate(definiteDueDate); + task.setPreferredDueDate(preferredDueDate); } if(hiddenUntil != null) task.setHiddenUntil(hiddenUntil); - if(estimatedSeconds != null) - task.setEstimatedSeconds(estimatedSeconds); + task.setEstimatedSeconds(estimatedSeconds); if(elapsedSeconds != null) task.setElapsedSeconds(elapsedSeconds); if(syncOnComplete != null) task.setFlags(task.getFlags() | TaskModelForSync.FLAG_SYNC_ON_COMPLETE); + else + task.setFlags(task.getFlags() & ~TaskModelForSync.FLAG_SYNC_ON_COMPLETE); // this is inaccurate. =/ if(repeatInfo != null) {