diff options
author | Rodrigo Moya <rodrigo@ximian.com> | 2002-09-25 00:08:59 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@src.gnome.org> | 2002-09-25 00:08:59 +0800 |
commit | e3a546e4d24101d65ad1217f10ac1e7576f5f3b7 (patch) | |
tree | b55fbd76dd72d46fcf17214b7e97ea5085f90d2d /calendar/pcs | |
parent | adf048e0505aa016e9b4c2ec13ab2050ee006906 (diff) | |
download | gsoc2013-evolution-e3a546e4d24101d65ad1217f10ac1e7576f5f3b7.tar gsoc2013-evolution-e3a546e4d24101d65ad1217f10ac1e7576f5f3b7.tar.gz gsoc2013-evolution-e3a546e4d24101d65ad1217f10ac1e7576f5f3b7.tar.bz2 gsoc2013-evolution-e3a546e4d24101d65ad1217f10ac1e7576f5f3b7.tar.lz gsoc2013-evolution-e3a546e4d24101d65ad1217f10ac1e7576f5f3b7.tar.xz 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
Diffstat (limited to 'calendar/pcs')
-rw-r--r-- | calendar/pcs/cal-backend-file.c | 23 |
1 files changed, 16 insertions, 7 deletions
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; } |