diff options
author | Suman Manjunath <msuman@src.gnome.org> | 2009-02-02 04:14:33 +0000 |
---|---|---|
committer | Suman Manjunath <msuman@src.gnome.org> | 2009-02-02 04:14:33 +0000 |
commit | 60cc3376e45e95bb77fa7d67f61d2d766fd54424 (patch) | |
tree | 4f03783fa4258ab1166776b31eda2b764bddfec5 | |
parent | 271970e7816d37c0692062a4e5e57cd1ec3984cb (diff) | |
download | evolution-data-server-60cc3376e45e95bb77fa7d67f61d2d766fd54424.tar.gz |
Patch from James Bottomley: Fix for bug #566809 (Don't process UTC periods in RDATES as though they were in local timezone).
svn path=/branches/gnome-2-24/; revision=10022
-rw-r--r-- | calendar/ChangeLog | 8 | ||||
-rw-r--r-- | calendar/libecal/e-cal-recur.c | 42 |
2 files changed, 29 insertions, 21 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 5dc57ff61..37ab4963c 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,11 @@ +2009-02-02 James Bottomley <jejbev@hansenpartnership.com> + + ** Fix for bug #566809 + + * libecal/e-cal-recur.c (generate_instances_for_chunk), + (cal_object_get_rdate_end): Don't process UTC periods in RDATES as + though they were in local timezone. + 2009-02-02 Petr Tomasek <tomasek@etf.cuni.cz> ** Fix for bug #429317 diff --git a/calendar/libecal/e-cal-recur.c b/calendar/libecal/e-cal-recur.c index f8a1190d0..0d6f77971 100644 --- a/calendar/libecal/e-cal-recur.c +++ b/calendar/libecal/e-cal-recur.c @@ -285,7 +285,8 @@ static void e_cal_recur_free (ECalRecurrence *r); static gboolean cal_object_get_rdate_end (CalObjTime *occ, - GArray *rdate_periods); + GArray *rdate_periods, + icaltimezone *zone); static void cal_object_compute_duration (CalObjTime *start, CalObjTime *end, gint *days, @@ -1203,18 +1204,17 @@ generate_instances_for_chunk (ECalComponent *comp, for (elem = rdates; elem; elem = elem->next) { ECalComponentPeriod *p; CalObjRecurrenceDate rdate; + struct icaltimetype tt; p = elem->data; - /* FIXME: We currently assume RDATEs are in the same timezone - as DTSTART. We should get the RDATE timezone and convert - to the DTSTART timezone first. */ - cotime.year = p->start.year; - cotime.month = p->start.month - 1; - cotime.day = p->start.day; - cotime.hour = p->start.hour; - cotime.minute = p->start.minute; - cotime.second = p->start.second; + tt = icaltime_convert_to_zone(p->start, zone); + cotime.year = tt.year; + cotime.month = tt.month - 1; + cotime.day = tt.day; + cotime.hour = tt.hour; + cotime.minute = tt.minute; + cotime.second = tt.second; cotime.flags = FALSE; /* If the rdate is after the current chunk we set finished @@ -1345,7 +1345,7 @@ generate_instances_for_chunk (ECalComponent *comp, /* If it is an RDATE, we see if the end date or duration was set. If not, we use the same duration as the original occurrence. */ - if (!cal_object_get_rdate_end (occ, rdate_periods)) { + if (!cal_object_get_rdate_end (occ, rdate_periods, zone)) { cal_obj_time_add_days (occ, duration_days); cal_obj_time_add_seconds (occ, duration_seconds); @@ -1400,7 +1400,8 @@ generate_instances_for_chunk (ECalComponent *comp, is set it returns FALSE and the default duration will be used. */ static gboolean cal_object_get_rdate_end (CalObjTime *occ, - GArray *rdate_periods) + GArray *rdate_periods, + icaltimezone *zone) { CalObjRecurrenceDate *rdate = NULL; ECalComponentPeriod *p; @@ -1433,15 +1434,14 @@ cal_object_get_rdate_end (CalObjTime *occ, p = rdate->period; if (p->type == E_CAL_COMPONENT_PERIOD_DATETIME) { - /* FIXME: We currently assume RDATEs are in the same timezone - as DTSTART. We should get the RDATE timezone and convert - to the DTSTART timezone first. */ - occ->year = p->u.end.year; - occ->month = p->u.end.month - 1; - occ->day = p->u.end.day; - occ->hour = p->u.end.hour; - occ->minute = p->u.end.minute; - occ->second = p->u.end.second; + struct icaltimetype tt = + icaltime_convert_to_zone(p->u.end, zone); + occ->year = tt.year; + occ->month = tt.month - 1; + occ->day = tt.day; + occ->hour = tt.hour; + occ->minute = tt.minute; + occ->second = tt.second; occ->flags = FALSE; } else { cal_obj_time_add_days (occ, p->u.duration.weeks * 7 |