Time zone classes proposal
David Jarvie
lists at astrojar.org.uk
Thu Sep 29 15:19:33 BST 2005
I have put together the basis of a proposed revision to the KDE time zone classes, approximately
along the lines of what I said in my previous posting. The new code is at
http://www.astrojar.org.uk/linux/download/ktimezones.h and
http://www.astrojar.org.uk/linux/download/ktimezones.cpp. It is based on the old classes, but is
substantially different in many respects.
The code is currently only a draft for comment - the classes aren't complete, and none of it has
been compiled or tested. And of course, it will need to be converted to Qt 4. Shaheed emailed me
today to say that he has also been revising the time zone code, and he will no doubt post it here
soon as well. Hopefully after that, we can decide on how to go forward.
The general comments at the top of ktimezones.h give a general description of how the new classes
work, and the rationale behind the design. Generally my aim has been to provide a generic
mechanism which will be equally suited to system time zones and to custom sources of time zone
information no matter what their format or access method. Much of the old design was specific to
system time zones, and was unsuitable for using as a basis for accessing other sources.
It's probably worth some specific comments on the callback mechanism in KTimezoneDetails, which I
have abandoned. These callback methods were only applicable to the TZFILE format used in the
system timezone database. Other data sources (e.g. iCalendar) can be in a completely different
format which would make implementing those callback functions complicated. Given that they are
tailored for one particular storage format, and that the information for the timezone was always
completely parsed anyway (there was no provision for early exit once the desired piece of
information is found), it is in fact more efficient simply to parse the entire information for the
time zone and then for the caller to access the desired data via KTimezoneSource methods.
--
David Jarvie.
KAlarm author and maintainer.
http://www.astrojar.org.uk/linux/kalarm.html
More information about the kde-core-devel
mailing list