Version:
Can't reproduce, nor can see how it could happen. Could you please describe your panel setup in a lot of detail? (Screenshots are good, too)
I can confirm this. Using KDE 3.1.3. I have the clock applet in the bottom right and the worldclock applet in the center of the screen in a small autohide-applet. When I move my mousepointer over the small worldclock applet, my clock changes it's time to the first one the worldclock applet shows me. e.g. Moving the mousepointer to Moskow, changed my clock from 20:44 to 22:44 (from Amsterdam-time to Moskow-time. When I go back to the worldclock applet, I can't reproduce this, until I change the clock aplet back to the right timezone.
I just noticed that, when I remove the worldclockapplet and add it again, the problem seems to be resolved.
I also noticed that after a relogin, the problem reappeared. :-(
I can reconfirm this. It happens to me about 80% of the time (it's not 100% reproducible.) When I move the cursor in the kworldclock applet, the KDE clock will change time to the time of the city over which I placed the cursor in the kworldclock applet. One way I can get the KDE clock back to normal is to right click on it, configure clock, apply and close. Then the KDE clock time goes back to normal. (Until I put my cursor in the kworldclock applet again - Ha, it just now did it!) This is a very annoying bug.
I should say, I'm using SUSE 9.0.
Hi. I can also reproduce this bug (and indeed it's quite disturbing since you can no longer trust the kicker clock). It only happens to me when kworldclock is in the kicker panel, not running as a standalone application. Ah, and I think I've found the fault. If $TZ is not initially present in the environment, kworldclock does not *unset* it after it's looked up the time in a different timezone. i.e., it calls: initial_TZ = getenv("TZ"); // initial_TZ == 0 since $TZ was not set setenv("TZ", new_timezone); time(); if (initialTZ != 0) setenv("TZ", initial_TZ); // FAILS because initial_TZ == 0 tzset(); // Still stuck in new_timezone This happens in both MapWidget::cityTime() and ZoneClock::updateTime(). Presumably the if (initialTZ != 0) setenv(...) needs to be followed by an else unsetenv("TZ"); in each place. I'll test this out tonight and see if it fixes the problem. Ben.
Yep, it fixes it for me. The patch is below (patch is against 3_1_BRANCH but should work fine with 3_2_BRANCH and HEAD also). Ben. --- kworldwatch/mapwidget.cpp 2 Mar 2003 21:50:43 -0000 1.16.2.2 +++ kworldwatch/mapwidget.cpp 17 Feb 2004 04:27:27 -0000 @@ -323,7 +323,10 @@ QString MapWidget::cityTime(QString city dt.setTime_t(t); result.append(QString("%1, %2").arg(KGlobal::locale()->formatTime(dt.time(), true)).arg(KGlobal::locale()->formatDate(dt.date(), true))); - if (initial_TZ != 0) setenv("TZ", initial_TZ, 1); + if (initial_TZ != 0) + setenv("TZ", initial_TZ, 1); + else + unsetenv("TZ"); tzset(); return result; } --- kworldwatch/zoneclock.cpp 4 Feb 2003 14:53:18 -0000 1.6.2.1 +++ kworldwatch/zoneclock.cpp 17 Feb 2004 04:27:27 -0000 @@ -131,7 +131,10 @@ void ZoneClock::updateTime() dt.setTime_t(t); _timeLabel->setText(QString("%1, %2").arg(KGlobal::locale()->formatTime(dt.time(), true)).arg(KGlobal::locale()->formatDate(dt.date(), true))); - if (initial_TZ != 0) setenv("TZ", initial_TZ, 1); + if (initial_TZ != 0) + setenv("TZ", initial_TZ, 1); + else + unsetenv("TZ"); tzset(); }
CVS commit by benb: Unset $TZ where appropriate so kworldclock doesn't mess with the kicker clock. CCMAIL: 56374-done@bugs.kde.org M +4 -1 mapwidget.cpp 1.25 M +4 -1 zoneclock.cpp 1.10 --- kdetoys/kworldwatch/mapwidget.cpp #1.24:1.25 @@ -359,5 +359,8 @@ QString MapWidget::cityTime(QString city result.append(QString("%1, %2").arg(KGlobal::locale()->formatTime(dt.time(), true)).arg(KGlobal::locale()->formatDate(dt.date(), true))); - if (initial_TZ != 0) setenv("TZ", initial_TZ, 1); + if (initial_TZ != 0) + setenv("TZ", initial_TZ, 1); + else + unsetenv("TZ"); tzset(); return result; --- kdetoys/kworldwatch/zoneclock.cpp #1.9:1.10 @@ -155,5 +155,8 @@ void ZoneClock::updateTime() _timeLabel->setText(QString("%1, %2").arg(KGlobal::locale()->formatTime(dt.time(), true)).arg(KGlobal::locale()->formatDate(dt.date(), true))); - if (initial_TZ != 0) setenv("TZ", initial_TZ, 1); + if (initial_TZ != 0) + setenv("TZ", initial_TZ, 1); + else + unsetenv("TZ"); tzset(); }