diff options
author | Ted Gould <ted@gould.cx> | 2010-03-16 20:51:22 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-03-16 20:51:22 -0500 |
commit | 5a06c7033c279c5421894ed99d01adb449568521 (patch) | |
tree | ce0b7901b47f2ed4b16e85a55e4e3048deed0750 /src | |
parent | 1a451a7dbf5eed2b4ea8fd1e221bac036c3b9d4b (diff) | |
download | ayatana-indicator-session-5a06c7033c279c5421894ed99d01adb449568521.tar.gz ayatana-indicator-session-5a06c7033c279c5421894ed99d01adb449568521.tar.bz2 ayatana-indicator-session-5a06c7033c279c5421894ed99d01adb449568521.zip |
Switching both of these function to using the generated header file.
Diffstat (limited to 'src')
-rw-r--r-- | src/users-service-dbus.c | 58 |
1 files changed, 5 insertions, 53 deletions
diff --git a/src/users-service-dbus.c b/src/users-service-dbus.c index 80ab5be..9e7af5d 100644 --- a/src/users-service-dbus.c +++ b/src/users-service-dbus.c @@ -1016,65 +1016,17 @@ users_service_dbus_get_user_list (UsersServiceDbus *self) gboolean users_service_dbus_activate_guest_session (UsersServiceDbus *self) { - - return FALSE; + UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self); + return org_gnome_DisplayManager_LocalDisplayFactory_switch_to_user(priv->gdm_local_proxy, "guest", NULL, NULL); } +/* Activates a specific user */ gboolean users_service_dbus_activate_user_session (UsersServiceDbus *self, UserData *user) { - UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self); - DBusMessage *message = NULL; - DBusMessage *reply = NULL; - DBusError error; - - dbus_error_init (&error); - - if (!(message = dbus_message_new_method_call ("org.gnome.DisplayManager", - "/org/gnome/DisplayManager/LocalDisplayFactory", - "org.gnome.DisplayManager.LocalDisplayFactory", - "SwitchToUser"))) - { - g_warning ("failed to create new message"); - return FALSE; - } - - if (!dbus_message_append_args (message, - DBUS_TYPE_STRING, &user->user_name, - DBUS_TYPE_INVALID)) - { - g_warning ("failed to append args"); - return FALSE; - } - - if (!(reply = dbus_connection_send_with_reply_and_block (dbus_g_connection_get_connection (priv->system_bus), - message, - -1, - &error))) - { - if (dbus_error_is_set (&error)) - { - g_warning ("Failed to send message: %s", error.message); - dbus_error_free (&error); - - return FALSE; - } - } - - if (message) - { - dbus_message_unref (message); - } - - if (reply) - { - dbus_message_unref (reply); - } - - dbus_error_free (&error); - - return TRUE; + UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self); + return org_gnome_DisplayManager_LocalDisplayFactory_switch_to_user(priv->gdm_local_proxy, user->user_name, NULL, NULL); } gboolean |