diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml
index 1aa55f5d3..fdbcef9cf 100644
--- a/res/values-de/strings.xml
+++ b/res/values-de/strings.xml
@@ -55,7 +55,7 @@
dates. c.f. Java's SimpleDateFormat -->
T\na\ng\ne
- S\nt\nu\nn\nd\ne\nn
+ U\nh\nr
- 1 Tag
- %d Tage
diff --git a/src/com/mdt/rtm/Invoker.java b/src/com/mdt/rtm/Invoker.java
index 5533aa746..bbc260d46 100644
--- a/src/com/mdt/rtm/Invoker.java
+++ b/src/com/mdt/rtm/Invoker.java
@@ -39,7 +39,6 @@ import org.apache.http.HttpVersion;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.DefaultConnectionReuseStrategy;
-import org.apache.http.impl.DefaultHttpClientConnection;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicHeader;
import org.apache.http.params.BasicHttpParams;
@@ -115,8 +114,6 @@ public class Invoker {
private HttpClient httpClient;
- private DefaultHttpClientConnection connection;
-
public Invoker(String serverHostName, int serverPortNumber, String serviceRelativeUri, ApplicationInfo applicationInfo)
throws ServiceInternalException
{
@@ -315,18 +312,7 @@ public class Invoker {
// }
finally
{
- if (connection != null && (response == null || connectionStrategy.keepAlive(response, context) == false))
- {
- try
- {
- connection.close();
- }
- catch (IOException exception)
- {
- Log.w(TAG, new StringBuffer("Could not close properly the socket connection to '").append(connection.getRemoteAddress()).append("' on port ").append(
- connection.getRemotePort()).toString(), exception);
- }
- }
+ httpClient.getConnectionManager().closeExpiredConnections();
}
lastInvocation = System.currentTimeMillis();
diff --git a/src/com/mdt/rtm/data/RtmData.java b/src/com/mdt/rtm/data/RtmData.java
index ddb92bd33..209ad1bd6 100644
--- a/src/com/mdt/rtm/data/RtmData.java
+++ b/src/com/mdt/rtm/data/RtmData.java
@@ -99,7 +99,7 @@ public abstract class RtmData
return result.toString();
}
- public static Date parseDate(String s)
+ public synchronized static Date parseDate(String s)
{
try
{
@@ -112,7 +112,7 @@ public abstract class RtmData
}
}
- public static String formatDate(Date d)
+ public synchronized static String formatDate(Date d)
{
return DATE_FORMAT.format(new Date(d.getTime() - TimeZone.getDefault().getOffset(d.getTime()))) + "Z";
}
diff --git a/src/com/mdt/rtm/data/RtmTaskNote.java b/src/com/mdt/rtm/data/RtmTaskNote.java
index d3e9716f9..df6f8489a 100644
--- a/src/com/mdt/rtm/data/RtmTaskNote.java
+++ b/src/com/mdt/rtm/data/RtmTaskNote.java
@@ -26,7 +26,7 @@ import org.w3c.dom.Text;
/**
* Represents a single task note.
- *
+ *
* @author Edouard Mercier
* @since 2008.04.22
*/
@@ -50,14 +50,14 @@ public class RtmTaskNote
created = parseDate(element.getAttribute("created"));
modified = parseDate(element.getAttribute("modified"));
title = element.getAttribute("title");
-
+
// The note text itself might be split across multiple children of the
// note element, so get all of the children.
for (int i=0; i {
nameValue = "(" + r.getString(R.string.taskList_hiddenPrefix) + ") " + nameValue;
task.putCachedLabel(KEY_HIDDEN, CACHE_TRUE);
}
- cachedResult = nameValue.toString();
+ cachedResult = nameValue;
task.putCachedLabel(KEY_NAME, cachedResult);
}
name.setText(cachedResult);
diff --git a/src/com/timsu/astrid/activities/TaskListSubActivity.java b/src/com/timsu/astrid/activities/TaskListSubActivity.java
index ad80a2868..4a878463a 100644
--- a/src/com/timsu/astrid/activities/TaskListSubActivity.java
+++ b/src/com/timsu/astrid/activities/TaskListSubActivity.java
@@ -137,7 +137,7 @@ public class TaskListSubActivity extends SubActivity {
static boolean syncPreferencesOpened = false;
// other instance variables
- class TaskListContext {
+ static class TaskListContext {
Map tagMap;
ArrayList taskArray;
HashMap tasksById;
diff --git a/src/com/timsu/astrid/data/AbstractModel.java b/src/com/timsu/astrid/data/AbstractModel.java
index 4f3d5ed19..98053c025 100644
--- a/src/com/timsu/astrid/data/AbstractModel.java
+++ b/src/com/timsu/astrid/data/AbstractModel.java
@@ -133,7 +133,7 @@ public abstract class AbstractModel {
setValues.put(field, newValue);
}
- protected static HashMap, HashMap>
+ protected static final HashMap, HashMap>
columnIndexCache = new HashMap, HashMap>();
private int getColumnIndex(String field) {
HashMap classCache;
diff --git a/src/com/timsu/astrid/data/tag/TagController.java b/src/com/timsu/astrid/data/tag/TagController.java
index ecfdcc1ab..f0e26abcf 100644
--- a/src/com/timsu/astrid/data/tag/TagController.java
+++ b/src/com/timsu/astrid/data/tag/TagController.java
@@ -153,7 +153,7 @@ public class TagController extends AbstractController {
AbstractTagModel.NAME + " = ?", new String[] {name}, null, null, null, null);
try {
- if (cursor != null) {
+ if (cursor != null && cursor.getCount() > 0) {
cursor.moveToFirst();
TagModelForView model = new TagModelForView(cursor);
return model;
diff --git a/src/com/timsu/astrid/sync/RTMSyncProvider.java b/src/com/timsu/astrid/sync/RTMSyncProvider.java
index ff8f5f1c9..034803e8c 100644
--- a/src/com/timsu/astrid/sync/RTMSyncProvider.java
+++ b/src/com/timsu/astrid/sync/RTMSyncProvider.java
@@ -246,8 +246,8 @@ public class RTMSyncProvider extends SynchronizationProvider {
postUpdate(new Runnable() {
public void run() {
DialogUtilities.okDialog(context,
- "Sorry, list '" + entry.getValue() +
- "' import failed. Try again later!", null);
+ "Sorry, import of list '" + entry.getValue() +
+ "' failed. Try again later!", null);
}
});
continue;
@@ -263,6 +263,7 @@ public class RTMSyncProvider extends SynchronizationProvider {
Preferences.setSyncRTMLastSync(context, syncTime);
} catch (Exception e) {
+ Log.e("rtmsync", "Error in synchronization", e);
showError(context, e, null);
} finally {
@@ -324,7 +325,7 @@ public class RTMSyncProvider extends SynchronizationProvider {
if(dueDate != remoteTask.dueDate && dueDate != null &&
!dueDate.equals(remoteTask.dueDate))
rtmService.tasks_setDueDate(timeline, id.listId, id.taskSeriesId,
- id.taskId, dueDate, dueDate != null);
+ id.taskId, dueDate, true);
// progress
if(task.progressPercentage != null && !task.progressPercentage.equals(
diff --git a/src/com/timsu/astrid/sync/SynchronizationProvider.java b/src/com/timsu/astrid/sync/SynchronizationProvider.java
index bb81c178d..5e0a11ef8 100644
--- a/src/com/timsu/astrid/sync/SynchronizationProvider.java
+++ b/src/com/timsu/astrid/sync/SynchronizationProvider.java
@@ -259,7 +259,7 @@ public abstract class SynchronizationProvider {
// remove it from data structures
data.localChanges.remove(mapping);
data.localIdToSyncMapping.remove(taskId);
- data.remoteIdToSyncMapping.remove(mapping);
+ data.remoteIdToSyncMapping.remove(mapping.getRemoteId());
data.remoteChangeMap.remove(taskId);
// update stats