diff options
Diffstat (limited to 'mate-session/gsm-consolekit.c')
-rw-r--r-- | mate-session/gsm-consolekit.c | 142 |
1 files changed, 71 insertions, 71 deletions
diff --git a/mate-session/gsm-consolekit.c b/mate-session/gsm-consolekit.c index a008c4c..dee78ab 100644 --- a/mate-session/gsm-consolekit.c +++ b/mate-session/gsm-consolekit.c @@ -243,7 +243,7 @@ gsm_consolekit_ensure_ck_connection (GsmConsolekit *manager, is_connected = TRUE; - out: +out: if (manager->priv->is_connected != is_connected) { manager->priv->is_connected = is_connected; g_object_notify (G_OBJECT (manager), "is-connected"); @@ -523,7 +523,7 @@ get_current_session_id (DBusConnection *connection, } ret = TRUE; - out: +out: if (message != NULL) { dbus_message_unref (message); } @@ -578,7 +578,7 @@ get_seat_id_for_session (DBusConnection *connection, } ret = TRUE; - out: +out: if (message != NULL) { dbus_message_unref (message); } @@ -709,7 +709,7 @@ seat_can_activate_sessions (DBusConnection *connection, dbus_message_iter_init (reply, &iter); dbus_message_iter_get_basic (&iter, &can_activate); - out: +out: if (message != NULL) { dbus_message_unref (message); } @@ -752,28 +752,28 @@ gsm_consolekit_can_switch_user (GsmConsolekit *manager) gboolean gsm_consolekit_get_restart_privileges (GsmConsolekit *manager) { - g_signal_emit (G_OBJECT (manager), - signals [PRIVILEGES_COMPLETED], - 0, TRUE, TRUE, NULL); + g_signal_emit (G_OBJECT (manager), + signals [PRIVILEGES_COMPLETED], + 0, TRUE, TRUE, NULL); - return TRUE; + return TRUE; } gboolean gsm_consolekit_get_stop_privileges (GsmConsolekit *manager) { - g_signal_emit (G_OBJECT (manager), - signals [PRIVILEGES_COMPLETED], - 0, TRUE, TRUE, NULL); + g_signal_emit (G_OBJECT (manager), + signals [PRIVILEGES_COMPLETED], + 0, TRUE, TRUE, NULL); - return TRUE; + return TRUE; } gboolean gsm_consolekit_can_restart (GsmConsolekit *manager) { gboolean res; - gboolean can_restart; + gboolean can_restart; GError *error; error = NULL; @@ -797,16 +797,16 @@ gsm_consolekit_can_restart (GsmConsolekit *manager) error->message); g_error_free (error); return FALSE; - } + } - return can_restart; + return can_restart; } gboolean gsm_consolekit_can_stop (GsmConsolekit *manager) { gboolean res; - gboolean can_stop; + gboolean can_stop; GError *error; error = NULL; @@ -831,76 +831,76 @@ gsm_consolekit_can_stop (GsmConsolekit *manager) error->message); g_error_free (error); return FALSE; - } + } - return can_stop; + return can_stop; } gchar * gsm_consolekit_get_current_session_type (GsmConsolekit *manager) { GError *gerror; - DBusConnection *connection; - DBusError error; - DBusMessage *message = NULL; - DBusMessage *reply = NULL; - gchar *session_id; - gchar *ret; - DBusMessageIter iter; - const char *value; - - session_id = NULL; - ret = NULL; + DBusConnection *connection; + DBusError error; + DBusMessage *message = NULL; + DBusMessage *reply = NULL; + gchar *session_id; + gchar *ret; + DBusMessageIter iter; + const char *value; + + session_id = NULL; + ret = NULL; gerror = NULL; if (!gsm_consolekit_ensure_ck_connection (manager, &gerror)) { g_warning ("Could not connect to ConsoleKit: %s", gerror->message); g_error_free (gerror); - goto out; - } - - connection = dbus_g_connection_get_connection (manager->priv->dbus_connection); - if (!get_current_session_id (connection, &session_id)) { - goto out; - } - - dbus_error_init (&error); - message = dbus_message_new_method_call (CK_NAME, - session_id, - CK_SESSION_INTERFACE, - "GetSessionType"); - if (message == NULL) { - goto out; - } - - reply = dbus_connection_send_with_reply_and_block (connection, - message, - -1, - &error); - - if (reply == NULL) { - if (dbus_error_is_set (&error)) { - g_warning ("Unable to determine session type: %s", error.message); - dbus_error_free (&error); - } - goto out; - } - - dbus_message_iter_init (reply, &iter); - dbus_message_iter_get_basic (&iter, &value); - ret = g_strdup (value); + goto out; + } + + connection = dbus_g_connection_get_connection (manager->priv->dbus_connection); + if (!get_current_session_id (connection, &session_id)) { + goto out; + } + + dbus_error_init (&error); + message = dbus_message_new_method_call (CK_NAME, + session_id, + CK_SESSION_INTERFACE, + "GetSessionType"); + if (message == NULL) { + goto out; + } + + reply = dbus_connection_send_with_reply_and_block (connection, + message, + -1, + &error); + + if (reply == NULL) { + if (dbus_error_is_set (&error)) { + g_warning ("Unable to determine session type: %s", error.message); + dbus_error_free (&error); + } + goto out; + } + + dbus_message_iter_init (reply, &iter); + dbus_message_iter_get_basic (&iter, &value); + ret = g_strdup (value); out: - if (message != NULL) { - dbus_message_unref (message); - } - if (reply != NULL) { - dbus_message_unref (reply); - } - g_free (session_id); - - return ret; + if (message != NULL) { + dbus_message_unref (message); + } + if (reply != NULL) { + dbus_message_unref (reply); + } + g_free (session_id); + + return ret; } |