[evolution-data-server] Bug #726060 - Password prompt initiated before D-Bus name acquired



commit c1a53c0f751afa5a8ffe2eaa4e4772a7a745a2fe
Author: Milan Crha <mcrha redhat com>
Date:   Wed Mar 26 08:22:57 2014 +0100

    Bug #726060 - Password prompt initiated before D-Bus name acquired

 .../evolution-source-registry.c                    |   31 +++++++++++++------
 1 files changed, 21 insertions(+), 10 deletions(-)
---
diff --git a/services/evolution-source-registry/evolution-source-registry.c 
b/services/evolution-source-registry/evolution-source-registry.c
index 8afeebc..b258c81 100644
--- a/services/evolution-source-registry/evolution-source-registry.c
+++ b/services/evolution-source-registry/evolution-source-registry.c
@@ -121,6 +121,22 @@ evolution_source_registry_load_all (ESourceRegistryServer *server,
        return TRUE;
 }
 
+static void
+evolution_source_registry_load_sources (ESourceRegistryServer *server,
+                                       GDBusConnection *connection)
+{
+       GError *error = NULL;
+
+       /* Failure here is fatal.  Don't even try to keep going. */
+       evolution_source_registry_load_all (server, &error);
+
+       if (error != NULL) {
+               g_printerr ("%s\n", error->message);
+               g_object_unref (server);
+               exit (EXIT_FAILURE);
+       }
+}
+
 gint
 main (gint argc,
       gchar **argv)
@@ -172,6 +188,11 @@ reload:
                evolution_source_registry_load_error),
                NULL);
 
+       /* Postpone the sources load only after the D-Bus name is acquired */
+       g_signal_connect (
+               server, "bus-acquired",
+               G_CALLBACK (evolution_source_registry_load_sources), NULL);
+
        /* Convert "imap" mail accounts to "imapx". */
        if (!opt_disable_migration)
                g_signal_connect (
@@ -179,16 +200,6 @@ reload:
                        evolution_source_registry_migrate_imap_to_imapx),
                        NULL);
 
-       /* Failure here is fatal.  Don't even try to keep going. */
-       evolution_source_registry_load_all (
-               E_SOURCE_REGISTRY_SERVER (server), &error);
-
-       if (error != NULL) {
-               g_printerr ("%s\n", error->message);
-               g_object_unref (server);
-               exit (EXIT_FAILURE);
-       }
-
        g_debug ("Server is up and running...");
 
        /* Keep the server from quitting on its own.


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