diff options
author | Travis Reitter <travis.reitter@collabora.co.uk> | 2011-06-07 16:15:31 -0700 |
---|---|---|
committer | Travis Reitter <travis.reitter@collabora.co.uk> | 2011-06-23 09:34:20 -0700 |
commit | 17814e50568b923df74d41d354b8108fdfd0ee22 (patch) | |
tree | a7dbc8a1ebc2fc6d3c2e9bac38706b9791ec7842 | |
parent | fa396c2ca0c6116959d4397438154de15393422c (diff) |
Factor out Tpf.Logger.prepare() from its constructor.
Helps: bgo#629716 - Migrate Folks to GDBus
-rw-r--r-- | backends/telepathy/lib/tpf-logger.vala | 14 | ||||
-rw-r--r-- | 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 ( |