diff options
author | Siegfried-Angel Gevatter Pujals <siegfried@gevatter.com> | 2012-02-07 23:45:47 +0100 |
---|---|---|
committer | Siegfried-Angel Gevatter Pujals <siegfried@gevatter.com> | 2012-02-07 23:45:47 +0100 |
commit | 25e4ce2f44cc2c565060cf8daa0548e2e8dd79a1 (patch) | |
tree | c050f1f1735480aef1da0e26df3659514454179c /python | |
parent | 65a4c0b2f1f5b3a7fd3f80010a6b2e99e2f5079a (diff) | |
download | zeitgeist-25e4ce2f44cc2c565060cf8daa0548e2e8dd79a1.tar.gz |
Fix monitors being installed twice; python-dbus always gives us a name
owner changed notification, so we want to ignore this first one.
Diffstat (limited to 'python')
-rw-r--r-- | python/client.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/python/client.py b/python/client.py index 9217979e..9976e964 100644 --- a/python/client.py +++ b/python/client.py @@ -179,6 +179,7 @@ class _DBusInterface(object): self._reconnect_when_needed = reconnect self._load_introspection_data() + self._first_connection = True self._disconnect_callbacks = set() self._reconnect_callbacks = set() @@ -188,6 +189,11 @@ class _DBusInterface(object): self.__methods = self.__signals = None for callback in self._disconnect_callbacks: callback() + elif self._first_connection: + # python-dbus guarantees that it'll call NameOwnerChanged at startup + # (even if the service was already running). When that happens, we + # don't want to connect the signals a second time. + self._first_connection = False else: if not self._reconnect_when_needed: return |