[hamster-applet] fixed the wonderous renaming issue. turns out we never did an update, just added new activity. fixes



commit 9e32f41116a6eb6c653246629388b154f1fe8eaa
Author: Toms Bauģis <toms baugis gmail com>
Date:   Thu May 21 15:04:38 2009 +0100

    fixed the wonderous renaming issue. turns out we never did an update, just added new activity. fixes bug 583437
---
 hamster/preferences.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/hamster/preferences.py b/hamster/preferences.py
index 543dcb7..c3b35c2 100755
--- a/hamster/preferences.py
+++ b/hamster/preferences.py
@@ -340,7 +340,11 @@ class PreferencesEditor:
                 self.select_activity(activity['id'])
                 return False
         
-        model[path][0] = storage.add_activity(new_text.decode("utf-8"), category_id)
+        
+        if id == -1: #new activity -> add
+            model[path][0] = storage.add_activity(new_text.decode("utf-8"), category_id)
+        else: #existing activity -> update
+            storage.update_activity(id, new_text.decode("utf-8"), category_id)
         model[path][1] = new_text
         return True
         



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