From e464eb64158290d37fbad8ce33a1b9c12d6d8bcc Mon Sep 17 00:00:00 2001 From: fosero Date: Sun, 6 Mar 2016 15:32:26 +0100 Subject: [PATCH] event: handle different tzid formats tzid can have different formats depending on where it originates from: regular or prefixed by a libical specific identifier. Use the right icaltimezone_get_builtin_timezone* for each case. https://bugzilla.gnome.org/show_bug.cgi?id=763180 --- src/gcal-event.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gcal-event.c b/src/gcal-event.c index 8880de78..145d7f94 100644 --- a/src/gcal-event.c +++ b/src/gcal-event.c @@ -19,6 +19,8 @@ #include "gcal-event.h" #include "gcal-utils.h" +#define LIBICAL_TZID_PREFIX "/freeassociation.sourceforge.net/" + struct _GcalEvent { GObject parent; @@ -95,7 +97,11 @@ get_timezone_from_ical (ECalComponentDateTime *comp) gchar *tzid; gint offset; - zone = icaltimezone_get_builtin_timezone (comp->tzid); + if (g_str_has_prefix (comp->tzid, LIBICAL_TZID_PREFIX)) + zone = icaltimezone_get_builtin_timezone_from_tzid (comp->tzid); + else + zone = icaltimezone_get_builtin_timezone (comp->tzid); + offset = icaltimezone_get_utc_offset (zone, comp->value, NULL); tzid = format_utc_offset (offset);