aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-10-07 10:28:49 -0600
committerTed Gould <ted@gould.cx>2010-10-07 10:28:49 -0600
commita60a4a596ba5acacf766ea63837a6334cb66dbf5 (patch)
tree6dd0e064852ac46df40ba5f89e07112a2a2a6f1a
parentd929aed8fbc3fc80a51df43f586c5cac122d8bc5 (diff)
downloadayatana-indicator-datetime-a60a4a596ba5acacf766ea63837a6334cb66dbf5.tar.gz
ayatana-indicator-datetime-a60a4a596ba5acacf766ea63837a6334cb66dbf5.tar.bz2
ayatana-indicator-datetime-a60a4a596ba5acacf766ea63837a6334cb66dbf5.zip
Caching the geoclue timezone
-rw-r--r--src/datetime-service.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/datetime-service.c b/src/datetime-service.c
index dffe002..7f37ac2 100644
--- a/src/datetime-service.c
+++ b/src/datetime-service.c
@@ -54,6 +54,7 @@ static DbusmenuMenuitem * tzchange = NULL;
/* Geoclue trackers */
static GeoclueMasterClient * geo_master = NULL;
static GeoclueAddress * geo_address = NULL;
+static gchar * geo_timezone = NULL;
/* Update the current timezone */
static void
@@ -290,6 +291,17 @@ geo_address_cb (GeoclueAddress * address, int timestamp, GHashTable * addy_data,
}
g_debug("Geoclue timezone is: %s", (gchar *)g_hash_table_lookup(addy_data, "timezone"));
+
+ if (geo_timezone != NULL) {
+ g_free(geo_timezone);
+ geo_timezone = NULL;
+ }
+
+ gpointer tz_hash = g_hash_table_lookup(addy_data, "timezone");
+ if (tz_hash != NULL) {
+ geo_timezone = g_strdup((gchar *)tz_hash);
+ }
+
return;
}