From a4f206c1399f3ed94c82e8846f328d3d9c81d37d Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Mon, 22 Dec 2003 18:27:33 +0000 Subject: if the setting is not in the config database, use the current time, to 2003-12-22 Rodrigo Moya * gui/alarm-notify/save.c (get_saved_notification_time): if the setting is not in the config database, use the current time, to avoid getting hundreds of alarms for past events. svn path=/trunk/; revision=24003 --- calendar/gui/alarm-notify/save.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'calendar/gui/alarm-notify') diff --git a/calendar/gui/alarm-notify/save.c b/calendar/gui/alarm-notify/save.c index d0b127fb99..5433cac806 100644 --- a/calendar/gui/alarm-notify/save.c +++ b/calendar/gui/alarm-notify/save.c @@ -78,14 +78,16 @@ time_t get_saved_notification_time (void) { GConfClient *conf_client; - long t; + GConfValue *value; if (!(conf_client = config_data_get_conf_client ())) return -1; - t = gconf_client_get_int (conf_client, KEY_LAST_NOTIFICATION_TIME, NULL); + value = gconf_client_get_without_default (conf_client, KEY_LAST_NOTIFICATION_TIME, NULL); + if (value) + return (time_t) gconf_value_get_int (value); - return (time_t) t; + return time (NULL); } /** -- cgit v1.2.3