aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2002-09-25 00:08:59 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2002-09-25 00:08:59 +0800
commite3a546e4d24101d65ad1217f10ac1e7576f5f3b7 (patch)
treeb55fbd76dd72d46fcf17214b7e97ea5085f90d2d
parentadf048e0505aa016e9b4c2ec13ab2050ee006906 (diff)
downloadgsoc2013-evolution-e3a546e4d24101d65ad1217f10ac1e7576f5f3b7.tar.gz
gsoc2013-evolution-e3a546e4d24101d65ad1217f10ac1e7576f5f3b7.tar.zst
gsoc2013-evolution-e3a546e4d24101d65ad1217f10ac1e7576f5f3b7.zip
return a builtin timezone if we don't find the timezone in our component.
2002-09-24 Rodrigo Moya <rodrigo@ximian.com> * pcs/cal-backend-file.c (cal_backend_file_get_timezone_object, cal_backend_file_get_timezone): return a builtin timezone if we don't find the timezone in our component. svn path=/trunk/; revision=18202
-rw-r--r--calendar/ChangeLog6
-rw-r--r--calendar/pcs/cal-backend-file.c23
2 files changed, 22 insertions, 7 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index e29f3e8086..87ac607143 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,9 @@
+2002-09-24 Rodrigo Moya <rodrigo@ximian.com>
+
+ * pcs/cal-backend-file.c (cal_backend_file_get_timezone_object,
+ cal_backend_file_get_timezone): return a builtin timezone if we
+ don't find the timezone in our component.
+
2002-09-24 JP Rosevear <jpr@ximian.com>
* conduits/calendar/calendar-conduit.c (comp_from_remote_record):
diff --git a/calendar/pcs/cal-backend-file.c b/calendar/pcs/cal-backend-file.c
index f4992f2952..c5b6c63df5 100644
--- a/calendar/pcs/cal-backend-file.c
+++ b/calendar/pcs/cal-backend-file.c
@@ -1070,8 +1070,11 @@ cal_backend_file_get_timezone_object (CalBackend *backend, const char *tzid)
g_assert (priv->comp_uid_hash != NULL);
zone = icalcomponent_get_timezone (priv->icalcomp, tzid);
- if (!zone)
- return NULL;
+ if (!zone) {
+ zone = icaltimezone_get_builtin_timezone_from_tzid (tzid);
+ if (!zone)
+ return NULL;
+ }
icalcomp = icaltimezone_get_component (zone);
if (!icalcomp)
@@ -1080,9 +1083,9 @@ cal_backend_file_get_timezone_object (CalBackend *backend, const char *tzid)
ical_string = icalcomponent_as_ical_string (icalcomp);
/* We dup the string; libical owns that memory. */
if (ical_string)
- return g_strdup (ical_string);
+ return g_strdup (ical_string);
else
- return NULL;
+ return NULL;
}
/* Builds a list of UIDs from a list of CalComponent objects */
@@ -1920,6 +1923,7 @@ cal_backend_file_get_timezone (CalBackend *backend, const char *tzid)
{
CalBackendFile *cbfile;
CalBackendFilePrivate *priv;
+ icaltimezone *zone;
cbfile = CAL_BACKEND_FILE (backend);
priv = cbfile->priv;
@@ -1927,9 +1931,14 @@ cal_backend_file_get_timezone (CalBackend *backend, const char *tzid)
g_return_val_if_fail (priv->icalcomp != NULL, NULL);
if (!strcmp (tzid, "UTC"))
- return icaltimezone_get_utc_timezone ();
- else
- return icalcomponent_get_timezone (priv->icalcomp, tzid);
+ zone = icaltimezone_get_utc_timezone ();
+ else {
+ zone = icalcomponent_get_timezone (priv->icalcomp, tzid);
+ if (!zone)
+ zone = icaltimezone_get_builtin_timezone_from_tzid (tzid);
+ }
+
+ return zone;
}