[gdm/accounts-service-split: 16/22] Get dbus connection outside of get_seat_proxy



commit 8abc93ba8da0bdfc8ea99f33174ef18c0e626bc9
Author: Ray Strode <rstrode redhat com>
Date:   Tue Mar 16 00:41:13 2010 -0400

    Get dbus connection outside of get_seat_proxy
    
    While having a connection is a prerequisite for get_seat_proxy,
    it could potentially be useful for other purposes, so move it
    out.

 gui/simple-greeter/gdm-user-manager.c |   28 ++++++++++++++++------------
 1 files changed, 16 insertions(+), 12 deletions(-)
---
diff --git a/gui/simple-greeter/gdm-user-manager.c b/gui/simple-greeter/gdm-user-manager.c
index 8c97c0a..cec9b1e 100644
--- a/gui/simple-greeter/gdm-user-manager.c
+++ b/gui/simple-greeter/gdm-user-manager.c
@@ -972,18 +972,6 @@ get_seat_proxy (GdmUserManager *manager)
 
         g_assert (manager->priv->seat_proxy == NULL);
 
-        error = NULL;
-        manager->priv->connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
-        if (manager->priv->connection == NULL) {
-                if (error != NULL) {
-                        g_warning ("Failed to connect to the D-Bus daemon: %s", error->message);
-                        g_error_free (error);
-                } else {
-                        g_warning ("Failed to connect to the D-Bus daemon");
-                }
-                return;
-        }
-
         manager->priv->seat_id = get_current_seat_id (manager->priv->connection);
         if (manager->priv->seat_id == NULL) {
                 return;
@@ -1714,6 +1702,7 @@ static void
 gdm_user_manager_init (GdmUserManager *manager)
 {
         char          *temp;
+        GError        *error;
         gboolean       res;
 
         manager->priv = GDM_USER_MANAGER_GET_PRIVATE (manager);
@@ -1748,6 +1737,21 @@ gdm_user_manager_init (GdmUserManager *manager)
                 monitor_local_users (manager);
         }
 
+
+        g_assert (manager->priv->seat_proxy == NULL);
+
+        error = NULL;
+        manager->priv->connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
+        if (manager->priv->connection == NULL) {
+                if (error != NULL) {
+                        g_warning ("Failed to connect to the D-Bus daemon: %s", error->message);
+                        g_error_free (error);
+                } else {
+                        g_warning ("Failed to connect to the D-Bus daemon");
+                }
+                return;
+        }
+
         get_seat_proxy (manager);
 
         queue_reload_users (manager);



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