From f6ce600828b196f96bc6e6d13a7b7e5b1cc99b48 Mon Sep 17 00:00:00 2001 From: Chenthill Palanisamy Date: Mon, 19 Sep 2005 08:10:53 +0000 Subject: Fixes #261625 svn path=/trunk/; revision=30358 --- calendar/ChangeLog | 7 +++++++ calendar/gui/alarm-notify/alarm.c | 18 +++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/calendar/ChangeLog b/calendar/ChangeLog index c8dd008191..25b85c9816 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,10 @@ +2005-09-08 P. S. Chakravarthi + + Fix #261625 + * gui/alarm-notify/alarm.c + (queue_alarm): add the alarm in the queue only when the + the alarm trigger time is after the current time. + 2005-09-01 Dinesh Layek Fixes #314922, 311694, 314918 diff --git a/calendar/gui/alarm-notify/alarm.c b/calendar/gui/alarm-notify/alarm.c index 6c57311c12..3d371d9f9b 100644 --- a/calendar/gui/alarm-notify/alarm.c +++ b/calendar/gui/alarm-notify/alarm.c @@ -141,6 +141,7 @@ setup_timeout (void) g_message (" %s", ctime (&ar->trigger)); g_message (" %s", ctime (&now)); timeout_id = g_timeout_add (diff * 1000, alarm_ready_cb, NULL); + } /* Used from g_list_insert_sorted(); compares the trigger times of two AlarmRecord structures. */ @@ -164,15 +165,18 @@ queue_alarm (AlarmRecord *ar) /* Track the current head of the list in case there are changes */ old_head = alarms; - /* Insert the new alarm in order */ - alarms = g_list_insert_sorted (alarms, ar, compare_alarm_by_time); + /* Insert the new alarm in order if the alarm's trigger time is + after the current time */ + if (ar->trigger > time (NULL)) { + alarms = g_list_insert_sorted (alarms, ar, compare_alarm_by_time); - /* If there first item on the list didn't change, the time out is fine */ - if (old_head == alarms) - return; + /* If there first item on the list didn't change, the time out is fine */ + if (old_head == alarms) + return; - /* Set the timer for removal upon activation */ - setup_timeout (); + /* Set the timer for removal upon activation */ + setup_timeout (); + } } -- cgit v1.2.3