diff options
author | Paul Bolle <pebolle@tiscali.nl> | 2009-11-28 04:15:55 +0800 |
---|---|---|
committer | Paul Bolle <pebolle@tiscali.nl> | 2009-11-28 04:15:55 +0800 |
commit | 46e5f2d7f950b00e6a523c29fbba9ba43632a80d (patch) | |
tree | 0ed9dd149d8be4f3f48875dd49365e961c79809c /calendar/conduits | |
parent | 77786ffd8457b704854f5572269a891103aad43b (diff) | |
download | gsoc2013-evolution-46e5f2d7f950b00e6a523c29fbba9ba43632a80d.tar.gz gsoc2013-evolution-46e5f2d7f950b00e6a523c29fbba9ba43632a80d.tar.zst gsoc2013-evolution-46e5f2d7f950b00e6a523c29fbba9ba43632a80d.zip |
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.)
Diffstat (limited to 'calendar/conduits')
-rw-r--r-- | 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 624615e49a..605845a84e 100644 --- a/calendar/conduits/calendar/calendar-conduit.c +++ b/calendar/conduits/calendar/calendar-conduit.c @@ -1109,36 +1109,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); |