D25289: Read floating date time as LocalTime.

Damien Caliste noreply at phabricator.kde.org
Wed Nov 13 17:03:27 GMT 2019


dcaliste added inline comments.

INLINE COMMENTS

> icalformat_p.cpp:2372
>      if (datetime.timeSpec() == Qt::UTC ||
> +        (datetime.timeSpec() == Qt::TimeZone && datetime.timeZone() == QTimeZone::utc()) ||
>          (datetime.timeSpec() == Qt::OffsetFromUTC && datetime.offsetFromUtc() == 0)) {

This is to avoid to create a DTSTART;TZID=UTC:20191113T12000000 entry. Which is understandable by the parser and by other software I guess, but is not conforming to RFC5545 (https://tools.ietf.org/html/rfc5545#section-3.3.5).

> icalformat_p.cpp:2501
>          }
> -        if (!timeZone.isValid()) {
> +        if (!timeZone.isValid() && !tzid.isEmpty()) {
>              // Fallback to trying to match against Qt timezone

Here, I needed to verify tzid because QTimeZone("") is returning the system time zone on my Debian and not an invalid time zone as the documentation is suggesting.

I don't know if it's a Qt bug or not. Reading the time zone related code is quite convoluted with a lot of ifdefs...

> icaltimezones.cpp:141
>      if (!tz.qZone.isValid()) {
> -        return QTimeZone::systemTimeZone();
> +        return QTimeZone();
>      }

The only call to this routine is from the icalformat_p.cpp in readICalDateTime if I grepped well. Thus changing this return for an imvalid QTimeZone should have no other impact than the one desired in this patch.

REPOSITORY
  R172 KCalendar Core

REVISION DETAIL
  https://phabricator.kde.org/D25289

To: dcaliste, vkrause, pvuorela, #kde_pim, dvratil
Cc: kde-pim, fbampaloukas, dcaliste, dvasin, rodsevich, winterz, vkrause, mlaurent, knauss, dvratil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20191113/2af139f2/attachment-0001.html>


More information about the kde-pim mailing list