From 030273f33da9c1ac7875d7319ffc6d78561719cf Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 24 Jul 2009 15:56:36 -0500 Subject: Checking the suspend and hibernate properties --- src/session-service.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'src/session-service.c') diff --git a/src/session-service.c b/src/session-service.c index 50e0f13..240f397 100644 --- a/src/session-service.c +++ b/src/session-service.c @@ -45,6 +45,18 @@ suspend_prop_cb (DBusGProxy * proxy, DBusGProxyCall * call, gpointer userdata) { suspend_call = NULL; + GValue candoit = {0}; + GError * error = NULL; + dbus_g_proxy_end_call(proxy, call, &error, G_TYPE_VALUE, &candoit, G_TYPE_INVALID); + if (error != NULL) { + g_warning("Unable to check suspend: %s", error->message); + g_error_free(error); + return; + } + g_debug("Got Suspend: %s", g_value_get_boolean(&candoit) ? "true" : "false"); + + + return; } static void @@ -52,6 +64,18 @@ hibernate_prop_cb (DBusGProxy * proxy, DBusGProxyCall * call, gpointer userdata) { hibernate_call = NULL; + GValue candoit = {0}; + GError * error = NULL; + dbus_g_proxy_end_call(proxy, call, &error, G_TYPE_VALUE, &candoit, G_TYPE_INVALID); + if (error != NULL) { + g_warning("Unable to check hibernate: %s", error->message); + g_error_free(error); + return; + } + g_debug("Got Hibernate: %s", g_value_get_boolean(&candoit) ? "true" : "false"); + + + return; } /* A signal that we need to recheck to ensure we can still @@ -71,7 +95,7 @@ dpk_changed_cb (DBusGProxy * proxy, gpointer user_data) G_TYPE_STRING, "can-suspend", G_TYPE_INVALID, - G_TYPE_BOOLEAN, + G_TYPE_VALUE, G_TYPE_INVALID); } @@ -88,7 +112,7 @@ dpk_changed_cb (DBusGProxy * proxy, gpointer user_data) G_TYPE_STRING, "can-hibernate", G_TYPE_INVALID, - G_TYPE_BOOLEAN, + G_TYPE_VALUE, G_TYPE_INVALID); -- cgit v1.2.3