[folks] Factor out Tpf.Logger.prepare() from its constructor.



commit 17814e50568b923df74d41d354b8108fdfd0ee22
Author: Travis Reitter <travis reitter collabora co uk>
Date:   Tue Jun 7 16:15:31 2011 -0700

    Factor out Tpf.Logger.prepare() from its constructor.
    
    Helps: bgo#629716 - Migrate Folks to GDBus

 backends/telepathy/lib/tpf-logger.vala        |   14 ++++++++++++--
 backends/telepathy/lib/tpf-persona-store.vala |    1 +
 2 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/backends/telepathy/lib/tpf-logger.vala b/backends/telepathy/lib/tpf-logger.vala
index f92d7df..990d8c9 100644
--- a/backends/telepathy/lib/tpf-logger.vala
+++ b/backends/telepathy/lib/tpf-logger.vala
@@ -52,8 +52,15 @@ internal class Logger : GLib.Object
   public signal void favourite_contacts_changed (string[] added,
       string[] removed);
 
-  public Logger (string account_path) throws TelepathyGLib.DBusError
+  public Logger (string account_path)
     {
+      this._account_path = account_path;
+    }
+
+  public async bool prepare ()
+    {
+      bool retval = false;
+
       if (this._logger == null)
         {
           /* Create a logger proxy for favourites support */
@@ -88,9 +95,10 @@ internal class Logger : GLib.Object
               this._logger = null;
               this.invalidated ();
             });
+
+          retval = true;
         }
 
-      this._account_path = account_path;
       this._logger.favourite_contacts_changed.connect ((ap, a, r) =>
         {
           if (ap != this._account_path)
@@ -98,6 +106,8 @@ internal class Logger : GLib.Object
 
           this.favourite_contacts_changed (a, r);
         });
+
+      return retval;
     }
 
   public async string[] get_favourite_contacts () throws GLib.Error
diff --git a/backends/telepathy/lib/tpf-persona-store.vala b/backends/telepathy/lib/tpf-persona-store.vala
index 8eb6f64..ea57b06 100644
--- a/backends/telepathy/lib/tpf-persona-store.vala
+++ b/backends/telepathy/lib/tpf-persona-store.vala
@@ -534,6 +534,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
               try
                 {
                   this._logger = new Logger (this.id);
+                  yield this._logger.prepare ();
                   this._logger.invalidated.connect (() =>
                     {
                       warning (



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