[hamster-applet] ignore seconds when trying to squeeze in fact
- From: Toms Baugis <tbaugis src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [hamster-applet] ignore seconds when trying to squeeze in fact
- Date: Sun, 22 Nov 2009 20:12:20 +0000 (UTC)
commit 539fe3f5fe8efc792b289d45d3f06ea7ea50db80
Author: Toms Bauģis <toms baugis gmail com>
Date: Sun Nov 22 20:12:03 2009 +0000
ignore seconds when trying to squeeze in fact
hamster/db.py | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/hamster/db.py b/hamster/db.py
index 6dd6de2..b6e8815 100644
--- a/hamster/db.py
+++ b/hamster/db.py
@@ -298,7 +298,13 @@ class Storage(storage.Storage):
#we are in middle of a fact - truncate it to our start
self.execute("UPDATE facts SET end_time=? WHERE id=?",
(start_time, fact["id"]))
- end_time = fact["end_time"]
+
+ # hamster is second-aware, but the edit dialog naturally is not
+ # so when an ongoing task is being edited, the seconds get truncated
+ # and the start time will be before previous task's end time.
+ # so set our end time only if it is not about seconds
+ if fact["end_time"].replace(second = 0) > start_time:
+ end_time = fact["end_time"]
else: #otherwise we have found a task that is after us
end_time = fact["start_time"]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]