Browse files

Merge pull request #465 from kuzmas/clock

Issue #460 fixed
  • Loading branch information...
2 parents d3ecae9 + 8e2e431 commit 4a3f183d1f11057cfb3f3465c0baf5bfc6715eb8 @kuzmas kuzmas committed Oct 23, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 razorqt-panel/plugin-clock/razorclock.cpp
View
5 razorqt-panel/plugin-clock/razorclock.cpp
@@ -102,7 +102,12 @@ RazorClock::RazorClock(const RazorPanelPluginStartInfo* startInfo, QWidget* pare
*/
void RazorClock::updateTime()
{
+#if QT_VERSION < 0x040700
+ QDateTime now(mUseUTC ? QDateTime::currentDateTime().toUTC() : QDateTime::currentDateTime());
+#else
QDateTime now(mUseUTC ? QDateTime::currentDateTimeUtc() : QDateTime::currentDateTime());
+#endif
+
if (mDateOnNewLine)
{
mTimeLabel->setText(QLocale::system().toString(now, mTimeFormat));

4 comments on commit 4a3f183

@mckaygerhard

I dont understand if converting current date to utc member its available in qt 4.7 as in qt 4.6 why using specific function from 4.7!!!!

thanks @kuzmas for this.

@kuzmas
Razor-qt member

Because comlexity of currentDateTimeUtc() almost equals (down to libc calls) to complexity of currentDateTime(),
but complexity of currentDateTime().toUTC() is much higher than complexity of currentDateTime().

In fact currentDateTimeUtc() has less calls to libc in comparison with currentDateTime(), while toUTC() itself has ~100 lines of code for timezone conversion.

@mckaygerhard

this its in time-compiling or runtime? in any case, this means that generated depends of currentDateTime().toUTC() generated strong dependency of libc6 rutines.. ok thanks for explain..

@kuzmas
Razor-qt member

I was talking about runtime complexity

Please sign in to comment.