[evolution-patches] [calendar-alarm] fix for #261625
- From: "Chakravarthi P" <pchakravarthi novell com>
- To: <evolution-patches gnome org>
- Subject: [evolution-patches] [calendar-alarm] fix for #261625
- Date: Thu, 08 Sep 2005 03:29:04 -0600
hi
Creating events in the past with alarm
immediately triggers an alarm.
This problem is because there is no check
made, while building the alarm queue, if
alarm trigger time is after the current time.
The patch adds that if statement.
regards.
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2802
diff -u -p -w -r1.2802 ChangeLog
--- ChangeLog 25 Aug 2005 10:26:27 -0000 1.2802
+++ ChangeLog 8 Sep 2005 08:51:56 -0000
@@ -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-08-24 Chenthill Palanisamy <pchenthill novell com>
Fixes #313705
Index: gui/alarm-notify/alarm.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/alarm-notify/alarm.c,v
retrieving revision 1.32
diff -u -p -w -r1.32 alarm.c
--- gui/alarm-notify/alarm.c 6 Aug 2004 09:48:52 -0000 1.32
+++ gui/alarm-notify/alarm.c 8 Sep 2005 08:51:57 -0000
@@ -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,7 +165,9 @@ 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 */
+ /* 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 */
@@ -173,6 +176,7 @@ queue_alarm (AlarmRecord *ar)
/* Set the timer for removal upon activation */
setup_timeout ();
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]