[evolution/gnome-2-28] Bug #551603 - Special case "positive zero alarms"
- From: Paul Bolle <pebolle src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [evolution/gnome-2-28] Bug #551603 - Special case "positive zero alarms"
- Date: Fri, 27 Nov 2009 21:31:39 +0000 (UTC)
commit 680feab2f8f9e9a6fa01500bc37fb26ef0b068c1
Author: Paul Bolle <pebolle tiscali nl>
Date: Fri Nov 27 21:15:55 2009 +0100
Bug #551603 - Special case "positive zero alarms"
Alarms triggered at the start of an appointment have a positive offset
(of zero) in their struct ECalComponentAlarmTrigger. This means they
are ignored in the current code (which only accepts negative
offsets). Add a special case for positive offsets of zero. (Palm
devices can not handle alarm triggers with a positive offset.)
calendar/conduits/calendar/calendar-conduit.c | 62 +++++++++++++-----------
1 files changed, 34 insertions(+), 28 deletions(-)
---
diff --git a/calendar/conduits/calendar/calendar-conduit.c b/calendar/conduits/calendar/calendar-conduit.c
index 0052c13..bc83f07 100644
--- a/calendar/conduits/calendar/calendar-conduit.c
+++ b/calendar/conduits/calendar/calendar-conduit.c
@@ -1105,36 +1105,42 @@ local_record_from_comp (ECalLocalRecord *local, ECalComponent *comp, ECalConduit
e_cal_component_alarm_get_trigger (alarm, &trigger);
e_cal_component_alarm_free (alarm);
- if ((trigger.type == E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START
- && trigger.u.rel_duration.is_neg)) {
- local->appt->advanceUnits = advMinutes;
- local->appt->advance =
- trigger.u.rel_duration.minutes
- + trigger.u.rel_duration.hours * 60
- + trigger.u.rel_duration.days * 60 * 24
- + trigger.u.rel_duration.weeks * 7 * 60 * 24;
-
- if (local->appt->advance > PILOT_MAX_ADVANCE) {
- local->appt->advanceUnits = advHours;
+ if (trigger.type == E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START) {
+ if (trigger.u.rel_duration.is_neg) {
+ local->appt->advanceUnits = advMinutes;
local->appt->advance =
- trigger.u.rel_duration.minutes / 60
- + trigger.u.rel_duration.hours
- + trigger.u.rel_duration.days * 24
- + trigger.u.rel_duration.weeks * 7 * 24;
- }
- if (local->appt->advance > PILOT_MAX_ADVANCE) {
- local->appt->advanceUnits = advDays;
- local->appt->advance =
- trigger.u.rel_duration.minutes / (60 * 24)
- + trigger.u.rel_duration.hours / 24
- + trigger.u.rel_duration.days
- + trigger.u.rel_duration.weeks * 7;
+ trigger.u.rel_duration.minutes
+ + trigger.u.rel_duration.hours * 60
+ + trigger.u.rel_duration.days * 60 * 24
+ + trigger.u.rel_duration.weeks * 7 * 60 * 24;
+
+ if (local->appt->advance > PILOT_MAX_ADVANCE) {
+ local->appt->advanceUnits = advHours;
+ local->appt->advance =
+ trigger.u.rel_duration.minutes / 60
+ + trigger.u.rel_duration.hours
+ + trigger.u.rel_duration.days * 24
+ + trigger.u.rel_duration.weeks * 7 * 24;
+ }
+ if (local->appt->advance > PILOT_MAX_ADVANCE) {
+ local->appt->advanceUnits = advDays;
+ local->appt->advance =
+ trigger.u.rel_duration.minutes / (60 * 24)
+ + trigger.u.rel_duration.hours / 24
+ + trigger.u.rel_duration.days
+ + trigger.u.rel_duration.weeks * 7;
+ }
+ if (local->appt->advance > PILOT_MAX_ADVANCE)
+ local->appt->advance = PILOT_MAX_ADVANCE;
+
+ local->appt->alarm = 1;
+ break;
+ } else if (icaldurationtype_is_null_duration (trigger.u.rel_duration)) {
+ local->appt->advanceUnits = advMinutes;
+ local->appt->advance = 0;
+ local->appt->alarm = 1;
+ break;
}
- if (local->appt->advance > PILOT_MAX_ADVANCE)
- local->appt->advance = PILOT_MAX_ADVANCE;
-
- local->appt->alarm = 1;
- break;
}
}
cal_obj_uid_list_free (uids);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]