Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar
diff options
context:
space:
mode:
authorJohn (J5) Palmieri <johnp@redhat.com>2007-08-24 22:25:56 (GMT)
committer John (J5) Palmieri <johnp@redhat.com>2007-08-24 22:25:56 (GMT)
commit2cae66b0ea86235788220c9f7b05aa2ad4fdc58f (patch)
treeaa592c5fcc95931b6a5a736d7c7cecafac6accf7 /sugar
parent628fe7b5da46b7618c391b91c9e130b30d4b6623 (diff)
More follow_name_owner_changed optimiztion
* reasoning changed from a FIXME to a NOTE to explain why we need to follow_name_owner_changed
Diffstat (limited to 'sugar')
-rw-r--r--sugar/activity/registry.py9
-rw-r--r--sugar/clipboard/clipboardservice.py9
-rw-r--r--sugar/presence/presenceservice.py9
3 files changed, 21 insertions, 6 deletions
diff --git a/sugar/activity/registry.py b/sugar/activity/registry.py
index 2f6b567..8fdae2f 100644
--- a/sugar/activity/registry.py
+++ b/sugar/activity/registry.py
@@ -50,10 +50,11 @@ class ActivityRegistry(gobject.GObject):
bus = dbus.SessionBus()
- # FIXME: Is follow_name_owner_changes what we really want?
- # It speeds up the start time by about 2 seconds
- # but is really a side effect of starting a proxy
- # in this state (i.e. we don't block in the constructor)
+ # NOTE: We need to follow_name_owner_changes here
+ # because we can not connect to a signal unless
+ # we follow the changes or we start the service
+ # before we connect. Starting the service here
+ # causes a major bottleneck during startup
bus_object = bus.get_object(_ACTIVITY_REGISTRY_SERVICE_NAME,
_ACTIVITY_REGISTRY_PATH,
follow_name_owner_changes = True)
diff --git a/sugar/clipboard/clipboardservice.py b/sugar/clipboard/clipboardservice.py
index 0e357fe..d975330 100644
--- a/sugar/clipboard/clipboardservice.py
+++ b/sugar/clipboard/clipboardservice.py
@@ -82,7 +82,14 @@ class ClipboardService(gobject.GObject):
"""Connect dbus signals to our GObject signal generating callbacks"""
bus = dbus.SessionBus()
if not self._connected:
- proxy_obj = bus.get_object(DBUS_SERVICE, DBUS_PATH)
+ # NOTE: We need to follow_name_owner_changes here
+ # because we can not connect to a signal unless
+ # we follow the changes or we start the service
+ # before we connect. Starting the service here
+ # causes a major bottleneck during startup
+ proxy_obj = bus.get_object(DBUS_SERVICE,
+ DBUS_PATH,
+ follow_name_owner_changes=True)
self._dbus_service = dbus.Interface(proxy_obj, DBUS_SERVICE)
self._dbus_service.connect_to_signal('object_added',
self._object_added_cb)
diff --git a/sugar/presence/presenceservice.py b/sugar/presence/presenceservice.py
index 4a92dd3..9e39a35 100644
--- a/sugar/presence/presenceservice.py
+++ b/sugar/presence/presenceservice.py
@@ -108,8 +108,15 @@ class PresenceService(gobject.GObject):
"""
if not self._ps_:
try:
+ # NOTE: We need to follow_name_owner_changes here
+ # because we can not connect to a signal unless
+ # we follow the changes or we start the service
+ # before we connect. Starting the service here
+ # causes a major bottleneck during startup
ps = dbus.Interface(
- self._bus.get_object(DBUS_SERVICE,DBUS_PATH),
+ self._bus.get_object(DBUS_SERVICE,
+ DBUS_PATH,
+ follow_name_owner_changes=True),
DBUS_INTERFACE
)
except dbus.exceptions.DBusException, err: