[gnome-calendar] event: handle different tzid formats



commit e464eb64158290d37fbad8ce33a1b9c12d6d8bcc
Author: fosero <fosero users noreply github com>
Date:   Sun Mar 6 15:32:26 2016 +0100

    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 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/gcal-event.c b/src/gcal-event.c
index 8880de7..145d7f9 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);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]