From d8ab004bf7433011c7edd39a10aa4ac83b0c454a Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Thu, 8 Sep 2011 13:18:24 -0700 Subject: [PATCH] Fixed a bug where you couldn't change the case of a list ever --- .../todoroo/astrid/actfm/TagViewActivity.java | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/TagViewActivity.java b/astrid/plugin-src/com/todoroo/astrid/actfm/TagViewActivity.java index 92b840a17..06067010c 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/TagViewActivity.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/TagViewActivity.java @@ -637,16 +637,22 @@ public class TagViewActivity extends TaskListActivity implements OnTabChangeList String newName = tagName.getText().toString(); boolean nameChanged = !oldName.equals(newName); + TagService service = TagService.getInstance(); if (nameChanged) { - TagService service = TagService.getInstance(); - newName = service.getTagWithCase(newName); - tagName.setText(newName); - if (!newName.equals(oldName)) { + if (oldName.equalsIgnoreCase(newName)) { // Change the capitalization of a list manually tagData.setValue(TagData.NAME, newName); - service.rename(oldName, newName); + service.renameCaseSensitive(oldName, newName); tagData.setFlag(TagData.FLAGS, TagData.FLAG_EMERGENT, false); - } else { - nameChanged = false; + } else { // Rename list--check for existing name + newName = service.getTagWithCase(newName); + tagName.setText(newName); + if (!newName.equals(oldName)) { + tagData.setValue(TagData.NAME, newName); + service.rename(oldName, newName); + tagData.setFlag(TagData.FLAGS, TagData.FLAG_EMERGENT, false); + } else { + nameChanged = false; + } } }