[qtbase] Detect system time zone from linked symlinks.
Run qDebug() << QTimeZone::systemTimeZoneId();
and enjoy the wonderful return value : timed/localtime
!
This comes from the fact that /etc/localtime is a symlink to /var/lib/timed/localtime which is itself a symlink to /usr/share/zoneinfo/Europe/Paris, but the routine to read the /etc/localtime symlink is waiting for one symlink only.
This is creating a real mess when doing for instance:
QDateTime date(QDate(2019, 05, 20), QTime(12, 00, 00), Qt::LocalTime);
QDateTime old(QDate(2010, 01, 01), QTime(08, 00, 00), Qt::Utc);
qDebug() << old.toZone(date);
because date
has no time zone (date.timeZone() is returning an invalid time zone, while it should return the system time zone, which is not supposed to be invalid). This kind of code is used everywhere in the new upstream kcalcore…
@pvuorela and @chriadam any remarks ? Should I propose it upstream also or is it very Mer specific ?