summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2014-08-20 09:53:32 -0400
committerRay Strode <rstrode@redhat.com>2014-08-21 10:15:20 -0400
commit4e22334f3f8897923766b75b19b1b0b2ffb1b0a9 (patch)
treeb8b15be232ead0af3796bf0de0d96c07a36bca3d
parentb0791a82f87796e070069375725ff12d11c927bb (diff)
downloadgdm-4e22334f3f8897923766b75b19b1b0b2ffb1b0a9.tar.gz
session: factor out duplicated code
The top half of stop_conversation and stop_conversation_now is and should remain identical. This commit refactors that part of each function into its own function. https://bugzilla.gnome.org/show_bug.cgi?id=727589
-rw-r--r--daemon/gdm-session.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
index 74bb4576..0c52d63b 100644
--- a/daemon/gdm-session.c
+++ b/daemon/gdm-session.c
@@ -1865,7 +1865,7 @@ start_conversation (GdmSession *self,
}
static void
-stop_conversation (GdmSessionConversation *conversation)
+close_conversation (GdmSessionConversation *conversation)
{
GdmSession *self = conversation->session;
@@ -1877,6 +1877,12 @@ stop_conversation (GdmSessionConversation *conversation)
GDBusConnection *connection = g_dbus_proxy_get_connection (G_DBUS_PROXY (conversation->worker_proxy));
g_dbus_connection_close_sync (connection, NULL, NULL);
}
+}
+
+static void
+stop_conversation (GdmSessionConversation *conversation)
+{
+ close_conversation (conversation);
conversation->is_stopping = TRUE;
gdm_session_worker_job_stop (conversation->job);
@@ -1885,16 +1891,7 @@ stop_conversation (GdmSessionConversation *conversation)
static void
stop_conversation_now (GdmSessionConversation *conversation)
{
- GdmSession *self = conversation->session;
-
- if (conversation->worker_manager_interface != NULL) {
- unexport_worker_manager_interface (self, conversation->worker_manager_interface);
- }
-
- if (conversation->worker_proxy != NULL) {
- GDBusConnection *connection = g_dbus_proxy_get_connection (G_DBUS_PROXY (conversation->worker_proxy));
- g_dbus_connection_close_sync (connection, NULL, NULL);
- }
+ close_conversation (conversation);
gdm_session_worker_job_stop_now (conversation->job);
g_clear_object (&conversation->job);