[gdm] session: factor out duplicated code
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdm] session: factor out duplicated code
- Date: Thu, 21 Aug 2014 14:15:57 +0000 (UTC)
commit 4e22334f3f8897923766b75b19b1b0b2ffb1b0a9
Author: Ray Strode <rstrode redhat com>
Date: Wed Aug 20 09:53:32 2014 -0400
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
daemon/gdm-session.c | 19 ++++++++-----------
1 files changed, 8 insertions(+), 11 deletions(-)
---
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
index 74bb457..0c52d63 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]