aboutsummaryrefslogtreecommitdiff
path: root/src/datetime-service.c
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-05-06 13:51:09 -0700
committerCharles Kerr <charles.kerr@canonical.com>2013-05-06 13:51:09 -0700
commitc6db70370a10da3ac86dd5fc979aad214b8e246b (patch)
treea2494c918e27f20033af0aafdce32258b864eb88 /src/datetime-service.c
parent5e6762db2485ef88859bdb8fcca636c3dc8aa832 (diff)
parent276524d99723ed2d9cfa2779003c918f160f9fa2 (diff)
downloadayatana-indicator-datetime-c6db70370a10da3ac86dd5fc979aad214b8e246b.tar.gz
ayatana-indicator-datetime-c6db70370a10da3ac86dd5fc979aad214b8e246b.tar.bz2
ayatana-indicator-datetime-c6db70370a10da3ac86dd5fc979aad214b8e246b.zip
sync with trunk
Diffstat (limited to 'src/datetime-service.c')
-rw-r--r--src/datetime-service.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/datetime-service.c b/src/datetime-service.c
index e7fc631..a8f941a 100644
--- a/src/datetime-service.c
+++ b/src/datetime-service.c
@@ -278,7 +278,7 @@ quick_set_tz_cb (GObject *object, GAsyncResult *res, gpointer data)
GVariant * answers = g_dbus_proxy_call_finish (G_DBUS_PROXY (object), res, &error);
if (error != NULL) {
- g_warning("Could not set timezone for SettingsDaemon: %s", error->message);
+ g_warning("Could not set timezone using timedated: %s", error->message);
g_clear_error (&error);
return;
}
@@ -294,13 +294,13 @@ quick_set_tz_proxy_cb (GObject *object, GAsyncResult *res, gpointer zone)
GDBusProxy * proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
if (error != NULL) {
- g_warning("Could not grab DBus proxy for SettingsDaemon: %s", error->message);
+ g_warning("Could not grab DBus proxy for timedated: %s", error->message);
g_clear_error (&error);
g_free (zone);
return;
}
- g_dbus_proxy_call (proxy, "SetTimezone", g_variant_new ("(s)", zone),
+ g_dbus_proxy_call (proxy, "SetTimezone", g_variant_new ("(sb)", zone, TRUE),
G_DBUS_CALL_FLAGS_NONE, -1, NULL, quick_set_tz_cb, NULL);
g_free (zone);
g_object_unref (proxy);
@@ -324,9 +324,9 @@ quick_set_tz (DbusmenuMenuitem * menuitem, guint timestamp, gpointer user_data)
g_object_unref (conf);
g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_NONE, NULL,
- "org.gnome.SettingsDaemon.DateTimeMechanism",
- "/",
- "org.gnome.SettingsDaemon.DateTimeMechanism",
+ "org.freedesktop.timedate1",
+ "/org/freedesktop/timedate1",
+ "org.freedesktop.timedate1",
NULL, quick_set_tz_proxy_cb, g_strdup (tz));
return;
@@ -1155,11 +1155,12 @@ static void
session_active_change_cb (GDBusProxy * proxy, gchar * sender_name, gchar * signal_name,
GVariant * parameters, gpointer user_data)
{
- // Just returned from suspend
- if (g_strcmp0(signal_name, "SystemIdleHintChanged") == 0) {
- gboolean idle = FALSE;
- g_variant_get(parameters, "(b)", &idle);
- if (!idle) {
+ // Suspending / returning from suspend (true / false)
+ if (g_strcmp0(signal_name, "PrepareForSleep") == 0) {
+ gboolean sleeping = FALSE;
+ g_variant_get (parameters, "(b)", &sleeping);
+ if (!sleeping) {
+ g_debug ("System has been resumed; adjusting clock");
on_clock_skew ();
}
}
@@ -1175,7 +1176,7 @@ system_proxy_cb (GObject * object, GAsyncResult * res, gpointer user_data)
GDBusProxy * proxy = g_dbus_proxy_new_for_bus_finish(res, &error);
if (error != NULL) {
- g_warning("Could not grab DBus proxy for ConsoleKit: %s", error->message);
+ g_warning("Could not grab DBus proxy for logind: %s", error->message);
g_clear_error (&error);
return;
}
@@ -1338,9 +1339,9 @@ main (int argc, char ** argv)
g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
G_DBUS_PROXY_FLAGS_NONE,
NULL,
- "org.freedesktop.ConsoleKit",
- "/org/freedesktop/ConsoleKit/Manager",
- "org.freedesktop.ConsoleKit.Manager",
+ "org.freedesktop.login1",
+ "/org/freedesktop/login1",
+ "org.freedesktop.login1.Manager",
NULL, system_proxy_cb, dbus);
mainloop = g_main_loop_new(NULL, FALSE);