diff options
author | Ray Strode <rstrode@redhat.com> | 2010-03-16 00:41:13 -0400 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2010-04-27 17:59:16 -0400 |
commit | 8abc93ba8da0bdfc8ea99f33174ef18c0e626bc9 (patch) | |
tree | fef6f34314c9b8b216dca64ef3c3b361c166b303 | |
parent | a6df273f4c2226444a2dfbbaea52a8a47f7e1309 (diff) | |
download | gdm-8abc93ba8da0bdfc8ea99f33174ef18c0e626bc9.tar.gz |
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.
-rw-r--r-- | 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 8c97c0a3..cec9b1ee 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); |