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/gui/alarm-notify/save.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'calendar/gui/alarm-notify') 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 v1.2.3