@@ -47,7 +47,7 @@ static QDateTime toQDateTime(const icaltimetype &t)
4747{
4848 return QDateTime (QDate (t.year , t.month , t.day ),
4949 QTime (t.hour , t.minute , t.second ),
50- (t. is_utc ? Qt::UTC : Qt::LocalTime));
50+ (icaltime_is_utc (t) ? Qt::UTC : Qt::LocalTime));
5151}
5252
5353// Maximum date for time zone data.
@@ -74,7 +74,6 @@ static icaltimetype writeLocalICalDateTime(const QDateTime &utc, int offset)
7474 t.second = local.time ().second ();
7575 t.is_date = 0 ;
7676 t.zone = nullptr ;
77- t.is_utc = 0 ;
7877 return t;
7978}
8079
@@ -632,7 +631,7 @@ bool ICalTimeZoneParser::parsePhase(icalcomponent *c, ICalTimeZonePhase &phase)
632631 // Convert DTSTART to QDateTime, and from local time to UTC
633632 const QDateTime localStart = toQDateTime (dtstart); // local time
634633 dtstart.second -= prevOffset;
635- dtstart. is_utc = 1 ;
634+ dtstart = icaltime_convert_to_zone (dtstart, icaltimezone_get_utc_timezone ()) ;
636635 const QDateTime utcStart = toQDateTime (icaltime_normalize (dtstart)); // UTC
637636
638637 phase.abbrevs .unite (abbrevs);
@@ -661,13 +660,12 @@ bool ICalTimeZoneParser::parsePhase(icalcomponent *c, ICalTimeZonePhase &phase)
661660 t.minute = dtstart.minute ;
662661 t.second = dtstart.second ;
663662 t.is_date = 0 ;
664- t.is_utc = 0 ; // dtstart is in local time
665663 }
666664 // RFC2445 states that RDATE must be in local time,
667665 // but we support UTC as well to be safe.
668- if (!t. is_utc ) {
666+ if (!icaltime_is_utc (t) ) {
669667 t.second -= prevOffset; // convert to UTC
670- t. is_utc = 1 ;
668+ t = icaltime_convert_to_zone (t, icaltimezone_get_utc_timezone ()) ;
671669 t = icaltime_normalize (t);
672670 }
673671 phase.transitions += toQDateTime (t);
0 commit comments