summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Reitter <travis.reitter@collabora.co.uk>2011-06-07 16:15:31 -0700
committerTravis Reitter <travis.reitter@collabora.co.uk>2011-06-23 09:34:20 -0700
commit17814e50568b923df74d41d354b8108fdfd0ee22 (patch)
treea7dbc8a1ebc2fc6d3c2e9bac38706b9791ec7842
parentfa396c2ca0c6116959d4397438154de15393422c (diff)
Factor out Tpf.Logger.prepare() from its constructor.
Helps: bgo#629716 - Migrate Folks to GDBus
-rw-r--r--backends/telepathy/lib/tpf-logger.vala14
-rw-r--r--backends/telepathy/lib/tpf-persona-store.vala1
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 (