[hamster-applet] never automatically delete a fact with description and allow to switch to same activity when descrip



commit 3227334d56b8b800c7d7c38d029536b8b35b2212
Author: Toms Bauģis <toms baugis gmail com>
Date:   Mon May 18 20:45:56 2009 +0100

    never automatically delete a fact with description and allow to switch to same activity when descriptions differ. fixes bug 581025
---
 hamster/db.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/hamster/db.py b/hamster/db.py
index 23db8ff..d62c579 100644
--- a/hamster/db.py
+++ b/hamster/db.py
@@ -319,11 +319,11 @@ class Storage(hamster.storage.Storage):
 
             if last_activity and last_activity['start_time'] < start_time:
                 #if this is the same, ongoing activity, then there is no need to create another one
-                if last_activity['activity_id'] == activity_id:
+                if not description and last_activity['activity_id'] == activity_id:
                     return last_activity
                 
-                # if it happened in last minute - remove previous entry or stop it
-                if 60 >= (start_time - last_activity['start_time']).seconds >= 0:
+                if not description and not last_activity["description"] \
+                   and 60 >= (start_time - last_activity['start_time']).seconds >= 0:
                     self.__remove_fact(last_activity['id'])
                     start_time = last_activity['start_time']
                 else:



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