Patch for kworldclock
Ben Burton
bab at debian.org
Tue Feb 17 21:18:28 GMT 2004
Hi. Does anyone mind if I commit the following patch for kworldclock?
It fixes the problem whereby the kworldclock applet messes with the time
shown on the kicker clock (#56374).
The patch attached is against KDE_3_1_BRANCH, but I'd like to make the
same fix to KDE_3_2_BRANCH and HEAD also.
(The cause of the problem is forgetting to unset the $TZ environment
variable in the case where it had not been set originally.)
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();
}
More information about the kde-core-devel
mailing list