From 7c027c63941fb1795ed21185927f446f337a64e7 Mon Sep 17 00:00:00 2001 From: Andrew Shaw Date: Wed, 22 Feb 2012 14:39:53 -0800 Subject: [PATCH] Fixed dissappearing comments in recent activity --- .../com/todoroo/astrid/actfm/TagUpdatesFragment.java | 1 + .../com/todoroo/astrid/notes/EditNoteActivity.java | 1 + astrid/src/com/todoroo/astrid/adapter/UpdateAdapter.java | 6 ++---- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/TagUpdatesFragment.java b/astrid/plugin-src/com/todoroo/astrid/actfm/TagUpdatesFragment.java index 2373f5131..42484dc30 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/TagUpdatesFragment.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/TagUpdatesFragment.java @@ -321,6 +321,7 @@ public class TagUpdatesFragment extends ListFragment { update.setValue(Update.TAGS, "," + tagData.getValue(TagData.REMOTE_ID) + ","); update.setValue(Update.TAGS_LOCAL, "," + tagData.getId() + ","); update.setValue(Update.CREATION_DATE, DateUtilities.now()); + update.setValue(Update.TARGET_NAME, tagData.getValue(TagData.NAME)); if (picture != null) { update.setValue(Update.PICTURE, Update.PICTURE_LOADING); try { diff --git a/astrid/plugin-src/com/todoroo/astrid/notes/EditNoteActivity.java b/astrid/plugin-src/com/todoroo/astrid/notes/EditNoteActivity.java index 894d56626..c663420bb 100644 --- a/astrid/plugin-src/com/todoroo/astrid/notes/EditNoteActivity.java +++ b/astrid/plugin-src/com/todoroo/astrid/notes/EditNoteActivity.java @@ -444,6 +444,7 @@ public class EditNoteActivity extends LinearLayout implements TimerActionListene update.setValue(Update.TASK, task.getValue(Task.REMOTE_ID)); update.setValue(Update.TASK_LOCAL, task.getId()); update.setValue(Update.CREATION_DATE, DateUtilities.now()); + update.setValue(Update.TARGET_NAME, task.getValue(Task.TITLE)); if (usePicture && pendingCommentPicture != null) { update.setValue(Update.PICTURE, Update.PICTURE_LOADING); diff --git a/astrid/src/com/todoroo/astrid/adapter/UpdateAdapter.java b/astrid/src/com/todoroo/astrid/adapter/UpdateAdapter.java index 8dde76499..094367df9 100644 --- a/astrid/src/com/todoroo/astrid/adapter/UpdateAdapter.java +++ b/astrid/src/com/todoroo/astrid/adapter/UpdateAdapter.java @@ -261,16 +261,14 @@ public class UpdateAdapter extends CursorAdapter { commentResource = R.string.update_string_task_assigned; } else if (actionCode.equals(UPDATE_TASK_COMMENT)) { - if (fromView.equals(FROM_TASK_VIEW)) + if (fromView.equals(FROM_TASK_VIEW) || TextUtils.isEmpty(targetName)) commentResource = R.string.update_string_default_comment; else commentResource = R.string.update_string_task_comment; - } else if (actionCode.equals(UPDATE_TAG_COMMENT)) { - if (fromView.equals(FROM_TAG_VIEW)) + if (fromView.equals(FROM_TAG_VIEW) || TextUtils.isEmpty(targetName)) commentResource = R.string.update_string_default_comment; - else commentResource = R.string.update_string_tag_comment;