[folks/folks-0-8] telepathy: Fix bus watching by multiple Tpf.PersonaStore instances



commit e8b03ed0793ee6b325c318759659ffdae791c1c3
Author: Philip Withnall <philip tecnocode co uk>
Date:   Fri Dec 28 12:50:35 2012 +0000

    telepathy: Fix bus watching by multiple Tpf.PersonaStore instances
    
    The bus needs to be watched by all Tpf.PersonaStores which are connected to
    the Logger instance, so that they all get the âinvalidatedâ signal.

 backends/telepathy/lib/tpf-logger.vala |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/backends/telepathy/lib/tpf-logger.vala b/backends/telepathy/lib/tpf-logger.vala
index 9ee8a16..011be78 100644
--- a/backends/telepathy/lib/tpf-logger.vala
+++ b/backends/telepathy/lib/tpf-logger.vala
@@ -45,6 +45,7 @@ private interface LoggerIface : Object
 
 internal class Logger : GLib.Object
 {
+  private static DBusConnection _dbus_conn;
   private static LoggerIface _logger;
   private uint _logger_watch_id;
 
@@ -93,13 +94,14 @@ internal class Logger : GLib.Object
               return retval;
             }
 
-          this._logger_watch_id = Bus.watch_name_on_connection (dbus_conn,
-              "org.freedesktop.Telepathy.Logger", BusNameWatcherFlags.NONE,
-              null, this._logger_vanished);
-
+          Logger._dbus_conn = dbus_conn;
           retval = true;
         }
 
+      this._logger_watch_id = Bus.watch_name_on_connection (Logger._dbus_conn,
+          "org.freedesktop.Telepathy.Logger", BusNameWatcherFlags.NONE,
+          null, this._logger_vanished);
+
       Logger._logger.favourite_contacts_changed.connect ((ap, a, r) =>
         {
           if (ap != this._account_path)
@@ -115,6 +117,7 @@ internal class Logger : GLib.Object
     {
       /* The logger has vanished on the bus, so it and we are no longer valid */
       Logger._logger = null;
+      Logger._dbus_conn = null;
       this.invalidated ();
     }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]