Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2007-07-09 18:14:24 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2007-07-09 18:14:24 (GMT)
commitecca1dca0011df7d40f424e89a75f0cc9193b874 (patch)
treeefdc5389300c609ba106ec0c45405d98af542405 /shell
parent1ae7a908eab97bd3a8475feec20ce490c725a1b7 (diff)
Add caching to the activity and object type registries.
Diffstat (limited to 'shell')
-rw-r--r--shell/shellservice.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/shell/shellservice.py b/shell/shellservice.py
index b4c96ff..c612d6e 100644
--- a/shell/shellservice.py
+++ b/shell/shellservice.py
@@ -56,6 +56,9 @@ class ShellService(dbus.service.Object):
self._home_model.connect('active-activity-changed',
self._cur_activity_changed_cb)
+ bundle_registry = bundleregistry.get_registry()
+ bundle_registry.connect('bundle-added', self._bundle_added_cb)
+
bus = dbus.SessionBus()
bus_name = dbus.service.BusName(_DBUS_SERVICE, bus=bus)
dbus.service.Object.__init__(self, bus_name, _DBUS_PATH)
@@ -121,6 +124,10 @@ class ShellService(dbus.service.Object):
return result
+ @dbus.service.signal(_DBUS_ACTIVITY_REGISTRY_IFACE, signature="a{sv}")
+ def ActivityAdded(self, activity_info):
+ pass
+
@dbus.service.signal(_DBUS_OWNER_IFACE, signature="s")
def ColorChanged(self, color):
pass
@@ -158,3 +165,7 @@ class ShellService(dbus.service.Object):
'icon': bundle.get_icon(),
'service_name': bundle.get_service_name(),
'path': bundle.get_path()}
+
+ def _bundle_added_cb(self, bundle_registry, bundle):
+ self.ActivityAdded(self._bundle_to_dict(bundle))
+