summaryrefslogtreecommitdiff
path: root/src/clock.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2011-04-19 23:16:49 -0700
committerMarcel Holtmann <marcel@holtmann.org>2011-04-19 23:16:49 -0700
commitb3cc6882f77a988373007f315be82b738803d60f (patch)
tree799a6b5f6d94899d50a392b7ea5cfe368b69b014 /src/clock.c
parent5a3891e6a038b0fb49869333db6f48b87ff6fe13 (diff)
downloadconnman-b3cc6882f77a988373007f315be82b738803d60f.tar.gz
connman-b3cc6882f77a988373007f315be82b738803d60f.tar.bz2
connman-b3cc6882f77a988373007f315be82b738803d60f.zip
clock: Add support for timezone change notifications
Diffstat (limited to 'src/clock.c')
-rw-r--r--src/clock.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/clock.c b/src/clock.c
index 2d3d4c07..1a1dfe88 100644
--- a/src/clock.c
+++ b/src/clock.c
@@ -288,6 +288,21 @@ static GDBusSignalTable clock_signals[] = {
static DBusConnection *connection = NULL;
+void __connman_clock_update_timezone(void)
+{
+ DBG("");
+
+ g_free(timezone_config);
+ timezone_config = __connman_timezone_lookup();
+
+ if (timezone_config == NULL)
+ return;
+
+ connman_dbus_property_changed_basic(CONNMAN_MANAGER_PATH,
+ CONNMAN_CLOCK_INTERFACE, "Timezone",
+ DBUS_TYPE_STRING, &timezone_config);
+}
+
int __connman_clock_init(void)
{
DBG("");
@@ -296,6 +311,8 @@ int __connman_clock_init(void)
if (connection == NULL)
return -1;
+ __connman_timezone_init();
+
timezone_config = __connman_timezone_lookup();
g_dbus_register_interface(connection, CONNMAN_MANAGER_PATH,
@@ -318,6 +335,8 @@ void __connman_clock_cleanup(void)
dbus_connection_unref(connection);
+ __connman_timezone_cleanup();
+
g_free(timezone_config);
g_strfreev(timeservers_config);
}