diff options
Diffstat (limited to 'calendar/pcs/query.c')
-rw-r--r-- | calendar/pcs/query.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/calendar/pcs/query.c b/calendar/pcs/query.c index ed391ee667..237b2524e1 100644 --- a/calendar/pcs/query.c +++ b/calendar/pcs/query.c @@ -442,6 +442,20 @@ instance_occur_cb (CalComponent *comp, time_t start, time_t end, gpointer data) return FALSE; } +/* FIXME. This is the same as the function in cal-backend-file.c. It needs + to be added to the backend interface, I think. */ +static icaltimezone* +resolve_tzid (const char *tzid, gpointer data) +{ + icalcomponent *vcalendar_comp = data; + + if (!strcmp (tzid, "UTC")) + return icaltimezone_get_utc_timezone (); + else + return icalcomponent_get_timezone (vcalendar_comp, tzid); +} + + /* (occur-in-time-range? START END) * * START - time_t, start of the time range @@ -459,6 +473,7 @@ func_occur_in_time_range (ESExp *esexp, int argc, ESExpResult **argv, void *data time_t start, end; gboolean occurs; ESExpResult *result; + icalcomponent *icalcomp, *vcalendar_comp; query = QUERY (data); priv = query->priv; @@ -490,7 +505,13 @@ func_occur_in_time_range (ESExp *esexp, int argc, ESExpResult **argv, void *data /* See if there is at least one instance in that range */ occurs = FALSE; - cal_recur_generate_instances (comp, start, end, instance_occur_cb, &occurs); + + /* Get the parent VCALENDAR component, so we can resolve TZIDs. */ + icalcomp = cal_component_get_icalcomponent (comp); + vcalendar_comp = icalcomponent_get_parent (icalcomp); + g_assert (vcalendar_comp != NULL); + + cal_recur_generate_instances (comp, start, end, instance_occur_cb, &occurs, resolve_tzid, vcalendar_comp); result = e_sexp_result_new (esexp, ESEXP_RES_BOOL); result->value.bool = occurs; |