hamster-applet r459 - trunk/hamster
- From: tbaugis svn gnome org
- To: svn-commits-list gnome org
- Subject: hamster-applet r459 - trunk/hamster
- Date: Mon, 1 Sep 2008 13:51:10 +0000 (UTC)
Author: tbaugis
Date: Mon Sep 1 13:51:10 2008
New Revision: 459
URL: http://svn.gnome.org/viewvc/hamster-applet?rev=459&view=rev
Log:
For new databases, start activity ID with 1 instead of 0.
Otherwise the first activity is doomed in "unsorted category"
fixes bug 549561.
Modified:
trunk/hamster/db.py
Modified: trunk/hamster/db.py
==============================================================================
--- trunk/hamster/db.py (original)
+++ trunk/hamster/db.py Mon Sep 1 13:51:10 2008
@@ -50,9 +50,8 @@
def __insert_category(self, name):
new_rec = self.fetchone("select max(id) +1, max(category_order) + 1 from categories")
- id, order = 1, 1
- if new_rec[0] and new_rec[1]: # handle case when we have no categories at all
- id, order = new_rec[0], new_rec[1]
+
+ id, order = new_rec[0] or 1, new_rec[1] or 1
query = """
INSERT INTO categories (id, name, category_order)
@@ -335,9 +334,7 @@
def __insert_activity(self, name, category_id = -1):
new_rec = self.fetchone("select max(id) + 1 , max(activity_order) + 1 from activities")
- new_id, new_order = 0, 0
- if new_rec[0] and new_rec[1]: # handle case when we have no activities at all
- new_id, new_order = new_rec[0], new_rec[1]
+ new_id, new_order = new_rec[0] or 1, new_rec[1] or 1
query = """
INSERT INTO activities (id, name, category_id, activity_order)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]