aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/pcs/query.c
diff options
context:
space:
mode:
authorDamon Chaplin <damon@ximian.com>2001-07-03 12:21:37 +0800
committerDamon Chaplin <damon@src.gnome.org>2001-07-03 12:21:37 +0800
commit642d32d63f226cd1ba049a9d979132e1a1cef94d (patch)
treebe4ef8fb72ca41391007554a6cbe97af41533555 /calendar/pcs/query.c
parentbacd3a85a434032316b3e63b95282175ce2b0659 (diff)
downloadgsoc2013-evolution-642d32d63f226cd1ba049a9d979132e1a1cef94d.tar
gsoc2013-evolution-642d32d63f226cd1ba049a9d979132e1a1cef94d.tar.gz
gsoc2013-evolution-642d32d63f226cd1ba049a9d979132e1a1cef94d.tar.bz2
gsoc2013-evolution-642d32d63f226cd1ba049a9d979132e1a1cef94d.tar.lz
gsoc2013-evolution-642d32d63f226cd1ba049a9d979132e1a1cef94d.tar.xz
gsoc2013-evolution-642d32d63f226cd1ba049a9d979132e1a1cef94d.tar.zst
gsoc2013-evolution-642d32d63f226cd1ba049a9d979132e1a1cef94d.zip
cal-client/cal-client.[hc] cal-util/cal-component.c
2001-07-03 Damon Chaplin <damon@ximian.com> * cal-client/cal-client.[hc] * cal-util/cal-component.c * cal-util/cal-recur.[hc] * cal-util/test-recur.c * cal-util/timeutil.c * gui/calendar-config.c * gui/calendar-model.[hc] * gui/comp-util.[hc] * gui/e-calendar-table.c * gui/e-day-view-main-item.c * gui/e-day-view-top-item.c * gui/e-day-view.[hc] * gui/e-itip-control.c * gui/e-timezone-entry.[hc] * gui/e-week-view.[hc] * gui/gnome-cal.[hc] * gui/goto.c * gui/tag-calendar.[hc] * gui/dialogs/cal-prefs-dialog.c * gui/dialogs/comp-editor-page.[hc] * gui/dialogs/comp-editor-util.[hc] * gui/dialogs/comp-editor.c * gui/dialogs/e-timezone-dialog.[hc] * gui/dialogs/event-page.c * gui/dialogs/meeting-page.c * gui/dialogs/recurrence-page.c * gui/dialogs/task-details-page.c * gui/dialogs/task-details-page.glade * gui/dialogs/task-page.c * idl/evolution-calendar.idl * pcs/cal-backend-file.c * pcs/cal-backend.c * pcs/cal-backend.h * pcs/cal.c * pcs/query.c: timezone changes everywhere. There's still quite a few things to update, and its not working well at present. svn path=/trunk/; revision=10729
Diffstat (limited to 'calendar/pcs/query.c')
-rw-r--r--calendar/pcs/query.c23
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;