aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/alarm-notify/alarm.c
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 /calendar/gui/alarm-notify/alarm.c
parenta9cbbe05130f5931cd87e84308f10f3e77b9d3bd (diff)
downloadgsoc2013-evolution-f6ce600828b196f96bc6e6d13a7b7e5b1cc99b48.tar.gz
gsoc2013-evolution-f6ce600828b196f96bc6e6d13a7b7e5b1cc99b48.tar.zst
gsoc2013-evolution-f6ce600828b196f96bc6e6d13a7b7e5b1cc99b48.zip
Fixes #261625
svn path=/trunk/; revision=30358
Diffstat (limited to 'calendar/gui/alarm-notify/alarm.c')
-rw-r--r--calendar/gui/alarm-notify/alarm.c18
1 files changed, 11 insertions, 7 deletions
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 ();
+ }
}