[gnome-online-accounts] telepathy: initialise the default Tp features in the Tp provider



commit a441b51188fe6c50dd89e6c37ec06d86c0fb2510
Author: Marco Barisione <marco barisione collabora co uk>
Date:   Tue Aug 27 14:24:12 2013 +0100

    telepathy: initialise the default Tp features in the Tp provider
    
    By initialising the default Telepathy features in the provider (so in
    libgoabackend) instead of in the daemon, we can rely on those features
    in every place where we use Telepathy.
    
    Ideally we should add a function to do this in tp-aw, but for now this
    is enough. See <https://bugzilla.gnome.org/show_bug.cgi?id=706892>.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=706894

 src/daemon/goatpaccountlinker.c       |   21 ---------------------
 src/goabackend/goatelepathyprovider.c |   22 ++++++++++++++++++++++
 2 files changed, 22 insertions(+), 21 deletions(-)
---
diff --git a/src/daemon/goatpaccountlinker.c b/src/daemon/goatpaccountlinker.c
index 0a3886a..ea1eda9 100644
--- a/src/daemon/goatpaccountlinker.c
+++ b/src/daemon/goatpaccountlinker.c
@@ -553,25 +553,6 @@ goa_tp_account_linker_dispose (GObject *object)
 }
 
 static void
-initialize_client_factory (void)
-{
-  TpSimpleClientFactory *factory;
-  TpAccountManager *account_manager;
-  GQuark features[] = { TP_ACCOUNT_FEATURE_STORAGE, 0 };
-
-  factory = tp_simple_client_factory_new (NULL);
-  /* We want to make sure that new TpAccount instances will have all
-   * the features we need. */
-  tp_simple_client_factory_add_account_features (factory, features);
-
-  account_manager = tp_account_manager_new_with_factory (factory);
-  tp_account_manager_set_default (account_manager);
-
-  g_object_unref (account_manager);
-  g_object_unref (factory);
-}
-
-static void
 goa_tp_account_linker_init (GoaTpAccountLinker *self)
 {
   GoaTpAccountLinkerPrivate *priv;
@@ -602,8 +583,6 @@ goa_tp_account_linker_class_init (GoaTpAccountLinkerClass *klass)
       sizeof (GoaTpAccountLinkerPrivate));
 
   gobject_class->dispose = goa_tp_account_linker_dispose;
-
-  initialize_client_factory ();
 }
 
 GoaTpAccountLinker *
diff --git a/src/goabackend/goatelepathyprovider.c b/src/goabackend/goatelepathyprovider.c
index 9e9d744..72a95a1 100644
--- a/src/goabackend/goatelepathyprovider.c
+++ b/src/goabackend/goatelepathyprovider.c
@@ -1028,11 +1028,33 @@ goa_telepathy_provider_finalize (GObject *object)
 }
 
 static void
+initialize_client_factory (void)
+{
+  TpSimpleClientFactory *factory;
+  TpAccountManager *account_manager;
+  GQuark features[] = { TP_ACCOUNT_FEATURE_STORAGE, 0 };
+
+  /* We make sure that new instances of Telepathy objects will have all
+   * the features we need. */
+
+  factory = tp_simple_client_factory_new (NULL);
+  tp_simple_client_factory_add_account_features (factory, features);
+
+  account_manager = tp_account_manager_new_with_factory (factory);
+  tp_account_manager_set_default (account_manager);
+
+  g_object_unref (account_manager);
+  g_object_unref (factory);
+}
+
+static void
 goa_telepathy_provider_class_init (GoaTelepathyProviderClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
   GoaProviderClass *provider_class = GOA_PROVIDER_CLASS (klass);
 
+  initialize_client_factory ();
+
   object_class->constructed  = goa_telepathy_provider_constructed;
   object_class->finalize     = goa_telepathy_provider_finalize;
   object_class->get_property = goa_telepathy_provider_get_property;


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