aboutsummaryrefslogtreecommitdiff
path: root/src/gtk-dialog
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-02-25 16:42:30 -0600
committerTed Gould <ted@gould.cx>2010-02-25 16:42:30 -0600
commitd605a1086d9fd4ca887c42c237aec5c246cda749 (patch)
treefc04df3e06eeb337140993c2c21d6718f9b0d070 /src/gtk-dialog
parent8689698b0545046a871730b24ad0eef6414dd990 (diff)
downloadayatana-indicator-session-d605a1086d9fd4ca887c42c237aec5c246cda749.tar.gz
ayatana-indicator-session-d605a1086d9fd4ca887c42c237aec5c246cda749.tar.bz2
ayatana-indicator-session-d605a1086d9fd4ca887c42c237aec5c246cda749.zip
can't really use async as we dont' have a mainloop here
Diffstat (limited to 'src/gtk-dialog')
-rw-r--r--src/gtk-dialog/gtk-logout-helper.c36
1 files changed, 15 insertions, 21 deletions
diff --git a/src/gtk-dialog/gtk-logout-helper.c b/src/gtk-dialog/gtk-logout-helper.c
index 7973bfc..c8635e6 100644
--- a/src/gtk-dialog/gtk-logout-helper.c
+++ b/src/gtk-dialog/gtk-logout-helper.c
@@ -30,15 +30,6 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include "gconf-helper.h"
static void
-console_kit_action_cb (DBusGProxy * proxy, DBusGProxyCall * call, void * data)
-{
- g_return_if_fail(DBUS_IS_G_PROXY(proxy));
- g_return_if_fail(call != NULL);
-
-
-}
-
-static void
consolekit_fallback (LogoutDialogAction action)
{
DBusGConnection * sbus = dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL);
@@ -52,25 +43,23 @@ consolekit_fallback (LogoutDialogAction action)
return;
}
+ GError * error = NULL;
+
switch (action) {
case LOGOUT_DIALOG_LOGOUT:
g_warning("Unable to fallback to ConsoleKit for logout as it's a session issue. We need some sort of session handler.");
break;
case LOGOUT_DIALOG_SHUTDOWN:
- dbus_g_proxy_begin_call(proxy,
- "Stop",
- console_kit_action_cb,
- NULL, /* data */
- NULL, /* destroy notifier */
- G_TYPE_INVALID);
+ dbus_g_proxy_call(proxy,
+ "Stop",
+ &error,
+ G_TYPE_INVALID);
break;
case LOGOUT_DIALOG_RESTART:
- dbus_g_proxy_begin_call(proxy,
- "Restart",
- console_kit_action_cb,
- NULL, /* data */
- NULL, /* destroy notifier */
- G_TYPE_INVALID);
+ dbus_g_proxy_call(proxy,
+ "Restart",
+ &error,
+ G_TYPE_INVALID);
break;
default:
g_warning("Unknown action");
@@ -79,6 +68,11 @@ consolekit_fallback (LogoutDialogAction action)
g_object_unref(proxy);
+ if (error != NULL) {
+ g_error("Unable to signal ConsoleKit: %s", error->message);
+ g_error_free(error);
+ }
+
return;
}