$OpenBSD: patch-kcal_icaltimezones_cpp,v 1.1 2017/11/08 05:37:50 ajacoutot Exp $

Fix build with libical >= 3.0.0

Index: kcal/icaltimezones.cpp
--- kcal/icaltimezones.cpp.orig
+++ kcal/icaltimezones.cpp
@@ -50,7 +50,7 @@ static QDateTime toQDateTime( const icaltimetype &t )
 {
   return QDateTime( QDate( t.year, t.month, t.day ),
                     QTime( t.hour, t.minute, t.second ),
-                    ( t.is_utc ? Qt::UTC : Qt::LocalTime ) );
+                    ( icaltime_is_utc(t) ? Qt::UTC : Qt::LocalTime ) );
 }
 
 // Maximum date for time zone data.
@@ -77,7 +77,6 @@ static icaltimetype writeLocalICalDateTime( const QDat
   t.second = local.time().second();
   t.is_date = 0;
   t.zone = 0;
-  t.is_utc = 0;
   return t;
 }
 
@@ -787,7 +786,7 @@ ICalTimeZone ICalTimeZoneSource::parse( icalcomponent 
     case ICAL_LASTMODIFIED_PROPERTY:
     {
       icaltimetype t = icalproperty_get_lastmodified(p);
-      if ( t.is_utc ) {
+      if ( icaltime_is_utc(t) ) {
         data->d->lastModified = toQDateTime( t );
       } else {
         kDebug() << "LAST-MODIFIED not UTC";
@@ -972,7 +971,7 @@ QList<QDateTime> ICalTimeZoneSourcePrivate::parsePhase
   // Convert DTSTART to QDateTime, and from local time to UTC
   QDateTime localStart = toQDateTime( dtstart );   // local time
   dtstart.second -= prevOffset;
-  dtstart.is_utc = 1;
+  dtstart = icaltime_convert_to_zone(dtstart, icaltimezone_get_utc_timezone());
   QDateTime utcStart = toQDateTime( icaltime_normalize( dtstart ) );   // UTC
 
   transitions += utcStart;
@@ -999,13 +998,12 @@ QList<QDateTime> ICalTimeZoneSourcePrivate::parsePhase
           t.minute = dtstart.minute;
           t.second = dtstart.second;
           t.is_date = 0;
-          t.is_utc = 0;    // dtstart is in local time
         }
         // RFC2445 states that RDATE must be in local time,
         // but we support UTC as well to be safe.
-        if ( !t.is_utc ) {
+        if ( !icaltime_is_utc(t) ) {
           t.second -= prevOffset;    // convert to UTC
-          t.is_utc = 1;
+          t = icaltime_convert_to_zone(t, icaltimezone_get_utc_timezone());
           t = icaltime_normalize( t );
         }
         transitions += toQDateTime( t );
