aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChenthill Palanisamy <pchen@src.gnome.org>2005-09-19 16:10:53 +0800
committerChenthill Palanisamy <pchen@src.gnome.org>2005-09-19 16:10:53 +0800
commitf6ce600828b196f96bc6e6d13a7b7e5b1cc99b48 (patch)
treeaf035885848f9f2396bd6e5d24ec22b10509c3b5
parenta9cbbe05130f5931cd87e84308f10f3e77b9d3bd (diff)
downloadgsoc2013-evolution-f6ce600828b196f96bc6e6d13a7b7e5b1cc99b48.tar.gz
gsoc2013-evolution-f6ce600828b196f96bc6e6d13a7b7e5b1cc99b48.tar.zst
gsoc2013-evolution-f6ce600828b196f96bc6e6d13a7b7e5b1cc99b48.zip
Fixes #261625
svn path=/trunk/; revision=30358
-rw-r--r--calendar/ChangeLog7
-rw-r--r--calendar/gui/alarm-notify/alarm.c18
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 <pchakravarthi@novell.com>
+
+ 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 <ldinesh@novell.com>
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 ();
+ }
}