[gnome-online-accounts/wip/rishi/account-remove: 3/6] daemon: Call goa_provider_initialize during start-up



commit e7bf893b1e3ca85fc3f1d30dd9438db74e4556a5
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu May 26 19:09:24 2016 +0200

    daemon: Call goa_provider_initialize during start-up
    
    https://bugzilla.gnome.org/show_bug.cgi?id=766733

 src/daemon/goadaemon.c |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/src/daemon/goadaemon.c b/src/daemon/goadaemon.c
index f9bce5a..c2d4da3 100644
--- a/src/daemon/goadaemon.c
+++ b/src/daemon/goadaemon.c
@@ -261,6 +261,9 @@ static void
 goa_daemon_init (GoaDaemon *self)
 {
   static volatile GQuark goa_error_domain = 0;
+  GError *error;
+  GList *l;
+  GList *providers = NULL;
   GoaObjectSkeleton *object;
   gchar *path;
 
@@ -270,7 +273,21 @@ goa_daemon_init (GoaDaemon *self)
   goa_error_domain = GOA_ERROR;
   goa_error_domain; /* shut up -Wunused-but-set-variable */
 
-  goa_provider_ensure_builtins_loaded ();
+  error = NULL;
+  if (!get_all_providers_sync (NULL, &providers, &error))
+    {
+      g_warning ("Unable to get the list of providers: %s (%s, %d)",
+                 error->message,
+                 g_quark_to_string (error->domain),
+                 error->code);
+      g_error_free (error);
+    }
+
+  for (l = providers; l != NULL; l = l->next)
+    {
+      GoaProvider *provider = GOA_PROVIDER (l->data);
+      goa_provider_initialize (provider);
+    }
 
   /* TODO: maybe nicer to pass in a GDBusConnection* construct property */
   self->connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL);


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