From d2353512a5f544d9eee94388e2f4090aed7b1ab0 Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Mon, 23 Sep 2002 09:59:35 +0000 Subject: only save the new notification time if it is bigger than the already saved 2002-09-23 Rodrigo Moya * gui/alarm-notify/save.c (save_notification_time): only save the new notification time if it is bigger than the already saved one. This should avoid some reminders showing up twice. svn path=/trunk/; revision=18162 --- calendar/ChangeLog | 6 ++++++ calendar/gui/alarm-notify/save.c | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 6ffc860a84..08d445dfca 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,9 @@ +2002-09-23 Rodrigo Moya + + * gui/alarm-notify/save.c (save_notification_time): only save the + new notification time if it is bigger than the already saved one. + This should avoid some reminders showing up twice. + 2002-09-20 JP Rosevear * gui/comp-util.c (cal_comp_is_on_server): check to see if the diff --git a/calendar/gui/alarm-notify/save.c b/calendar/gui/alarm-notify/save.c index 455af7f883..dc78686250 100644 --- a/calendar/gui/alarm-notify/save.c +++ b/calendar/gui/alarm-notify/save.c @@ -53,13 +53,19 @@ void save_notification_time (time_t t) { EConfigListener *cl; + time_t current_t; g_return_if_fail (t != -1); if (!(cl = config_data_get_listener ())) return; - e_config_listener_set_long (cl, KEY_LAST_NOTIFICATION_TIME, (long) t); + /* we only store the new notification time if it is bigger + than the already stored one */ + current_t = e_config_listener_get_long_with_default (cl, KEY_LAST_NOTIFICATION_TIME, + -1, NULL); + if (t > current_t) + e_config_listener_set_long (cl, KEY_LAST_NOTIFICATION_TIME, (long) t); } /** -- cgit