aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/pcs/query.c
diff options
context:
space:
mode:
authorDamon Chaplin <damon@ximian.com>2001-07-03 14:06:18 +0800
committerDamon Chaplin <damon@src.gnome.org>2001-07-03 14:06:18 +0800
commit2c95c4d8e9f237bc2428b05d976d01241d3394ba (patch)
treeb6f880580e7fef54fb777c1981cad63f463c530c /calendar/pcs/query.c
parenteb52ee5a862b132e6c0655cd44b5887d64ead3ca (diff)
downloadgsoc2013-evolution-2c95c4d8e9f237bc2428b05d976d01241d3394ba.tar
gsoc2013-evolution-2c95c4d8e9f237bc2428b05d976d01241d3394ba.tar.gz
gsoc2013-evolution-2c95c4d8e9f237bc2428b05d976d01241d3394ba.tar.bz2
gsoc2013-evolution-2c95c4d8e9f237bc2428b05d976d01241d3394ba.tar.lz
gsoc2013-evolution-2c95c4d8e9f237bc2428b05d976d01241d3394ba.tar.xz
gsoc2013-evolution-2c95c4d8e9f237bc2428b05d976d01241d3394ba.tar.zst
gsoc2013-evolution-2c95c4d8e9f237bc2428b05d976d01241d3394ba.zip
added virtual method to get a VTIMEZONE component given a TZID. We need
2001-07-03 Damon Chaplin <damon@ximian.com> * pcs/cal-backend.[hc]: added virtual method to get a VTIMEZONE component given a TZID. We need this to resolve TZIDs when expanding an event using cal_recur_generate_instances() in query.c. * pcs/cal-backend-file.c (cal_backend_file_get_timezone): implemented virtual method. (cal_backend_file_update_object): fixed bug, kind -> child_kind. * pcs/query.c (func_occur_in_time_range): use the virtual method for resolving TZIDs. The other way didn't work anyway, as we didn't have the entire VCALENDAR with VTIMEZONEs in it. * gui/dialogs/recurrence-page.c (init_widgets): (make_ending_until_special): moved the call to e_date_edit_set_get_time_callback() from init_widgets to make_ending_until_special(), since that is where the widget gets created. * gui/e-timezone-entry.c (e_timezone_entry_set_timezone): handle zone being NULL. svn path=/trunk/; revision=10732
Diffstat (limited to 'calendar/pcs/query.c')
-rw-r--r--calendar/pcs/query.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/calendar/pcs/query.c b/calendar/pcs/query.c
index 237b2524e1..6f3e276ae0 100644
--- a/calendar/pcs/query.c
+++ b/calendar/pcs/query.c
@@ -442,17 +442,16 @@ 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. */
+/* Call the backend function to get a timezone from a TZID. */
static icaltimezone*
resolve_tzid (const char *tzid, gpointer data)
{
- icalcomponent *vcalendar_comp = data;
+ Query *query = data;
- if (!strcmp (tzid, "UTC"))
- return icaltimezone_get_utc_timezone ();
+ if (!tzid || !tzid[0])
+ return NULL;
else
- return icalcomponent_get_timezone (vcalendar_comp, tzid);
+ return cal_backend_get_timezone (query->priv->backend, tzid);
}
@@ -473,7 +472,6 @@ 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;
@@ -506,12 +504,9 @@ func_occur_in_time_range (ESExp *esexp, int argc, ESExpResult **argv, void *data
occurs = FALSE;
- /* 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);
+ cal_recur_generate_instances (comp, start, end,
+ instance_occur_cb, &occurs,
+ resolve_tzid, query);
result = e_sexp_result_new (esexp, ESEXP_RES_BOOL);
result->value.bool = occurs;