aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-datetime.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/indicator-datetime.c')
-rw-r--r--src/indicator-datetime.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c
index 983a76f..7f8b58d 100644
--- a/src/indicator-datetime.c
+++ b/src/indicator-datetime.c
@@ -382,6 +382,7 @@ set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec
self->priv->show_seconds = !self->priv->show_seconds;
if (self->priv->time_mode != SETTINGS_TIME_CUSTOM) {
update = TRUE;
+ setup_timer(self);
}
}
break;
@@ -411,6 +412,7 @@ set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec
self->priv->custom_string = g_strdup(newstr);
if (self->priv->time_mode == SETTINGS_TIME_CUSTOM) {
update = TRUE;
+ setup_timer(self);
}
}
break;
@@ -552,6 +554,11 @@ timer_func (gpointer user_data)
static void
setup_timer (IndicatorDatetime * self)
{
+ if (self->priv->timer != 0) {
+ g_source_remove(self->priv->timer);
+ self->priv->timer = 0;
+ }
+
self->priv->timer = g_timeout_add_seconds(60, timer_func, self);
return;
}