[hamster-applet] should be pretty much usable now again
- From: Toms Baugis <tbaugis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [hamster-applet] should be pretty much usable now again
- Date: Tue, 13 Apr 2010 15:59:10 +0000 (UTC)
commit a4ab8fad79916a7ca88d0692d0ae8d93d3dfb217
Author: Toms Bauģis <toms baugis gmail com>
Date: Tue Apr 13 16:58:14 2010 +0100
should be pretty much usable now again
src/hamster/client.py | 3 ++-
src/hamster/storage.py | 15 +++++++++++++--
2 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/src/hamster/client.py b/src/hamster/client.py
index 06d405b..58b241b 100644
--- a/src/hamster/client.py
+++ b/src/hamster/client.py
@@ -157,6 +157,7 @@ class Storage(object):
def get_activities(self, category_id = None):
+ category_id = category_id or -1
return self.conn.GetActivities(category_id)
@@ -173,7 +174,7 @@ class Storage(object):
self.conn.MoveActivity(source_id, target_order, insert_after)
def change_category(self, id, category_id):
- self.conn.ChangeCategory(id, category_id)
+ return self.conn.ChangeCategory(id, category_id)
def swap_activities(self, id1, priority1, id2, priority2):
self.conn.SwapActivities(id1, priority1, id2, priority2)
diff --git a/src/hamster/storage.py b/src/hamster/storage.py
index 0ee37f5..466e959 100644
--- a/src/hamster/storage.py
+++ b/src/hamster/storage.py
@@ -300,7 +300,17 @@ class Storage(dbus.service.Object):
@dbus.service.method("org.gnome.Hamster", in_signature='i', out_signature='aa{sv}')
def GetActivities(self, category_id = None):
- return [dict(activity) for activity in self.__get_activities(category_id = category_id)]
+ if not category_id or category_id == -1:
+ category_id = None
+
+ res = []
+ for activity in self.__get_activities(category_id = category_id):
+ activity = dict(activity)
+ activity['category'] = activity['category'] or ''
+
+ res.append(activity)
+
+ return res
@dbus.service.method("org.gnome.Hamster", in_signature='s', out_signature='aa{sv}')
@@ -321,11 +331,12 @@ class Storage(dbus.service.Object):
self.ActivitiesChanged()
- @dbus.service.method("org.gnome.Hamster", in_signature='ii')
+ @dbus.service.method("org.gnome.Hamster", in_signature='ii', out_signature = 'b')
def ChangeCategory(self, id, category_id):
changed = self.__change_category(id, category_id)
if changed:
self.ActivitiesChanged()
+ return changed
@dbus.service.method("org.gnome.Hamster", in_signature='iiii')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]