From 642d32d63f226cd1ba049a9d979132e1a1cef94d Mon Sep 17 00:00:00 2001 From: Damon Chaplin Date: Tue, 3 Jul 2001 04:21:37 +0000 Subject: cal-client/cal-client.[hc] cal-util/cal-component.c 2001-07-03 Damon Chaplin * 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 --- calendar/cal-util/cal-component.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'calendar/cal-util/cal-component.c') diff --git a/calendar/cal-util/cal-component.c b/calendar/cal-util/cal-component.c index 36c6408d59..2669dc5562 100644 --- a/calendar/cal-util/cal-component.c +++ b/calendar/cal-util/cal-component.c @@ -883,7 +883,7 @@ ensure_mandatory_properties (CalComponent *comp) struct icaltimetype t; tim = time (NULL); - t = icaltime_from_timet (tim, FALSE); + t = icaltime_from_timet_with_zone (tim, FALSE, icaltimezone_get_utc_timezone ()); priv->dtstamp = icalproperty_new_dtstamp (t); icalcomponent_add_property (priv->icalcomp, priv->dtstamp); @@ -1822,8 +1822,12 @@ get_datetime (struct datetime *datetime, } else dt->value = NULL; + /* If the icaltimetype has is_utc set, we set "UTC" as the TZID. + This makes the timezone code simpler. */ if (datetime->tzid_param) dt->tzid = icalparameter_get_tzid (datetime->tzid_param); + else if (dt->value && dt->value->is_utc) + dt->tzid = "UTC"; else dt->tzid = NULL; } @@ -1853,6 +1857,10 @@ set_datetime (CalComponent *comp, struct datetime *datetime, g_return_if_fail (dt->value != NULL); + /* If the TZID is set to "UTC", we set the is_utc flag. */ + if (dt->tzid && !strcmp (dt->tzid, "UTC")) + dt->value->is_utc = 1; + if (datetime->prop) (* prop_set_func) (datetime->prop, *dt->value); else { @@ -1860,7 +1868,8 @@ set_datetime (CalComponent *comp, struct datetime *datetime, icalcomponent_add_property (priv->icalcomp, datetime->prop); } - if (dt->tzid) { + /* If the TZID is set to "UTC", we don't want to save the TZID. */ + if (dt->tzid && strcmp (dt->tzid, "UTC")) { g_assert (datetime->prop != NULL); if (datetime->tzid_param) -- cgit v1.2.3