[hamster-applet] allow changing case for activity. fixes bug 619676



commit eb66f79b8645c63bbc43c21ee755d9376b69ef52
Author: Toms Bauģis <toms baugis gmail com>
Date:   Sat Jun 5 19:30:58 2010 +0100

    allow changing case for activity. fixes bug 619676

 src/hamster/preferences.py |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/hamster/preferences.py b/src/hamster/preferences.py
index 37cf547..447eb13 100755
--- a/src/hamster/preferences.py
+++ b/src/hamster/preferences.py
@@ -466,11 +466,12 @@ class PreferencesEditor:
         id = model[path][0]
         category_id = model[path][2]
 
-        #look for dupes
+
+        # avoid two activities in same category with same name
         activities = runtime.storage.get_category_activities(category_id)
         for activity in activities:
-            if activity['name'].lower() == new_text.lower():
-                if id == -1: # that was a new category
+            if id != activity['id'] and activity['name'].lower() == new_text.lower():
+                if id == -1: # that was a new activity
                     self.activity_store.remove(model.get_iter(path))
                 self.select_activity(activity['id'])
                 return False



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]