RTM tag spaces->underscores, optimized RTM a bit more on new task transmitting.

pull/14/head
Tim Su 17 years ago
parent 7f737c7021
commit ea0a114b9b

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.timsu.astrid"
android:versionCode="69"
android:versionName="2.1.1">
android:versionCode="71"
android:versionName="2.1.3">
<meta-data android:name="com.a0soft.gphone.aTrackDog.webURL"
android:value="http://www.weloveastrid.com" />

@ -476,7 +476,7 @@ public class ServiceImpl implements Service
StringBuilder tagString = new StringBuilder();
if(tags != null) {
for(int i = 0; i < tags.length; i++) {
tagString.append(tags[i]);
tagString.append(tags[i].replace(" ", "_"));
if(i < tags.length - 1)
tagString.append(",");
}

@ -251,6 +251,15 @@ public class RTMSyncService extends SynchronizationService {
}
}
/** Get a task proxy with default RTM values */
private TaskProxy getDefaultTaskProxy() {
TaskProxy taskProxy = new TaskProxy(0, "", false);
taskProxy.progressPercentage = 0;
taskProxy.tags = new LinkedList<String>();
taskProxy.notes = "";
return taskProxy;
}
/** Send changes for the given TaskProxy across the wire */
private void pushLocalTask(String timeline, TaskProxy task, TaskProxy remoteTask,
SyncMapping mapping) throws ServiceException {
@ -263,7 +272,7 @@ public class RTMSyncService extends SynchronizationService {
remoteTask = parseRemoteTask(id.listId, rtmTask);
}
if(remoteTask == null)
remoteTask = new TaskProxy(0, "", false);
remoteTask = getDefaultTaskProxy();
if(task.name != null && !task.name.equals(remoteTask.name))
rtmService.tasks_setName(timeline, id.listId, id.taskSeriesId,
@ -277,7 +286,7 @@ public class RTMSyncService extends SynchronizationService {
if(dueDate == null)
dueDate = task.preferredDueDate;
if(dueDate != remoteTask.definiteDueDate &&
(dueDate == null || !dueDate.equals(remoteTask.definiteDueDate)))
!dueDate.equals(remoteTask.definiteDueDate))
rtmService.tasks_setDueDate(timeline, id.listId, id.taskSeriesId,
id.taskId, dueDate, dueDate != null);
@ -308,7 +317,8 @@ public class RTMSyncService extends SynchronizationService {
}
// estimated time
if(task.estimatedSeconds != null && !task.estimatedSeconds.equals(remoteTask.estimatedSeconds)) {
if(task.estimatedSeconds != remoteTask.estimatedSeconds &&
!task.estimatedSeconds.equals(remoteTask.estimatedSeconds)) {
String estimation;
int estimatedSeconds = task.estimatedSeconds;
if(estimatedSeconds == 0)

Loading…
Cancel
Save