On Fri, 2010-09-03 at 11:40 +0100, Patrick Ohly wrote:
> My understanding is that timed holds the information about the current
> system time zone. Looking at ksystemtimezone.cpp in kcalcore, it seems
> that timed uses the full path to the zone file to identify the current
> zone. Is that correct?
> 
> void KSystemTimeZonesPrivate::readConfig(bool init)
> {
> ...
>     m_zoneinfoDir = "/usr/share/zoneinfo";
>     m_zonetab = "/usr/share/zoneinfo/zone.tab";
>     Maemo::Timed::Interface timed;
>     QDBusReply<Maemo::Timed::WallClock::Info> reply =
> timed.get_wall_clock_info_sync();
>     if (reply.isValid()) {
>       Maemo::Timed::WallClock::Info info = reply.value();
>       QString localzone = info.etcLocaltime();
>       kDebug() << "localzone" << localzone;
>       // TODO now we have to parse local timezone from symlink, Ilya
> will 
>       // possibly change this to support previous solution, commented
> below
>       QString x = localzone.mid(localzone.lastIndexOf("/"));
>       QString y = localzone.mid(0,(localzone.lastIndexOf("/")));
>       x.prepend(y.mid(y.lastIndexOf("/")+1));
>       m_localZoneName = x;
> 
>       //QFile f("/etc/timezone");
>       //if (f.open(QIODevice::ReadOnly)) {
>       //QTextStream str(&f);
>       //m_localZoneName = str.readLine();
>       //f.close();
>       //}
> 
> I'm not entirely sure about this string parsing here. What is the input,
> what is the output? Note that some time zones contain multiple slashes,
> like America/Kentucky/Louisville. If
> localzone==/usr/share/zoneinfo/America/Kentucky/Louisville, then the
> code above incorrectly sets m_localZoneName=Kentucky/Louisville.

"man timed" confirms
that /usr/share/zoneinfo/America/Kentucky/Louisville is returned, so the
mkcal code is going to fail in that part of the world => BMC #6440.

> How does mkcal determine the list of system time zones and read their
> definitions? I found that it parses /usr/share/zoneinfo/zone.tab, and
> there is a KSystemTimeZoneSource::parse(), but where is the code which
> actually parses a file like /usr/share/zoneinfo/Europe/Berlin?

This question is still relevant.

> I wrote some debug code which dumps the system time zones. All of them
> are said to have no summer saving time transitions, which cannot be
> right:
> 
>     KTimeZones::ZoneMap zones = KSystemTimeZones::zones();
>     BOOST_FOREACH (const KTimeZone &zone, zones) {
>         SE_LOG_INFO(NULL, NULL, "zone: %s (%s), %s",
>                     zone.name().toLocal8Bit().constData(),
>                     zone.countryCode().toLocal8Bit().constData(),
>                     zone.hasTransitions() ? "has transitions" : "no
> transitions");
>     }
> 
> [INFO] zone: Africa/Abidjan (CI), no transitions
> [INFO] zone: Africa/Accra (GH), no transitions
> [INFO] zone: Africa/Addis_Ababa (ET), no transitions
> ...
> [INFO] zone: Europe/Berlin (DE), no transitions
> ...
> [INFO] zone: Pacific/Wallis (WF), no transitions
> 
> My expectation was that the time zone handling code in libical, in
> particular icaltimezone_get_builtin_timezones(), is used for all of
> this, but that doesn't seem to be the case.

I wrote a test program which tries to use "Europe/Berlin". The exported
VCALENDAR does not contain a valid VTIMEZONE, so something is broken =>
BMC #6438.

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.


_______________________________________________
MeeGo-dev mailing list
[email protected]
http://lists.meego.com/listinfo/meego-dev

Reply via email to