KDE Core/QtMerge/QTimeZone

From KDE Community Wiki
Revision as of 10:36, 12 February 2012 by Jlayt (talk | contribs) (→‎QTimeZone)

QTimeZone

ICU

Qt5 locale will move to depending on ICU for localisation backend. ICU implements timezone support so any solution must well with this. ICU ships a version of Olsen which can be outdated and different form the system,by guarantees canonical tz names. It also provides translations to Windows tz names in ICU 4.4 and later.

References:

ICU does have a nasty API for most things, but that's what Qt is for :-)

Qt Proposals

Steve has made a proposal based on Python.

Lorn Potter has previously proposed patches based on Meego:

KDateTime vs QDateTime

KDateTime obtains the current system time zone from KSystemTimeZones::local(), which in turn requires the ktimezoned daemon to update it with any changes to the current system time zone. This would prevent KDateTime from being moved into Qt without modification to this mechanism. Additionally, Qt would need to support Mac OSX and any other operating systems - currently, KSystemTimeZones is only supported on Linux and Windows. Note that all the KTimeZone classes would need to be moved to Qt also in order for KDateTime to work.

If KDateTime were merged into QDateTime, it would probably require source incompatible changes to create a nice API for the combined class.

A better way of merging KDateTime into Qt4 would be to add a new class alongside QDateTime. QDateTime would be kept as a simple class without any time spec (source incompatible change), alongside the merged KDateTime to be used when any time spec was needed. It wouldn't be a good idea to keep QDateTime unchanged in this scenario, since the current QDateTime's time spec property wouldn't play along very nicely with the new KDateTime class's more sophisticated time spec property - having both would lead to unnecessary confusion.