aboutsummaryrefslogtreecommitdiff
path: root/src/datetime-service.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-10-07 15:41:02 -0600
committerTed Gould <ted@gould.cx>2010-10-07 15:41:02 -0600
commit95d2587e7467162a9382b600f0ea1912690c7082 (patch)
tree407956273c5f475cc4d27bbf7871a3af4c0551dd /src/datetime-service.c
parent62f947b4b613cd6ee0a5d296eeefc488b4ba0ae6 (diff)
downloadayatana-indicator-datetime-95d2587e7467162a9382b600f0ea1912690c7082.tar.gz
ayatana-indicator-datetime-95d2587e7467162a9382b600f0ea1912690c7082.tar.bz2
ayatana-indicator-datetime-95d2587e7467162a9382b600f0ea1912690c7082.zip
Make a little more robust and actually commit our results.
Diffstat (limited to 'src/datetime-service.c')
-rw-r--r--src/datetime-service.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/datetime-service.c b/src/datetime-service.c
index 60fa7eb..b4a1135 100644
--- a/src/datetime-service.c
+++ b/src/datetime-service.c
@@ -131,13 +131,34 @@ update_current_timezone (void) {
return;
}
+/* See how our timezone setting went */
+static void
+quick_set_tz_cb (OobsObject * obj, OobsResult result, gpointer user_data)
+{
+ if (result == OOBS_RESULT_OK) {
+ g_debug("Timezone set");
+ } else {
+ g_warning("Unable to quick set timezone");
+ }
+ return;
+}
+
/* Set the timezone to the Geoclue discovered one */
static void
quick_set_tz (DbusmenuMenuitem * menuitem, guint timestamp, const gchar *command)
{
- OobsTimeConfig * timeconfig = OOBS_TIME_CONFIG(oobs_time_config_get());
+ g_debug("Quick setting timezone to: %s", geo_timezone);
+
+ g_return_if_fail(geo_timezone != NULL);
+
+ OobsObject * obj = oobs_time_config_get();
+ g_return_if_fail(obj != NULL);
+
+ OobsTimeConfig * timeconfig = OOBS_TIME_CONFIG(obj);
oobs_time_config_set_timezone(timeconfig, geo_timezone);
- g_object_unref(G_OBJECT(timeconfig));
+
+ oobs_object_commit_async(obj, quick_set_tz_cb, NULL);
+
return;
}