diff options
Diffstat (limited to 'lumina-desktop/panel-plugins')
-rw-r--r-- | lumina-desktop/panel-plugins/clock/LClock.cpp | 4 | ||||
-rw-r--r-- | lumina-desktop/panel-plugins/clock/LClock.h | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/lumina-desktop/panel-plugins/clock/LClock.cpp b/lumina-desktop/panel-plugins/clock/LClock.cpp index e91a3a71..79cae84b 100644 --- a/lumina-desktop/panel-plugins/clock/LClock.cpp +++ b/lumina-desktop/panel-plugins/clock/LClock.cpp @@ -35,6 +35,7 @@ LClock::~LClock(){ void LClock::updateTime(){ QDateTime CT = QDateTime::currentDateTime(); + if(useTZ){ CT = CT.toTimeZone(TZ); } //Now update the display QString label; if(deftime){ label = CT.time().toString(Qt::SystemLocaleShortDate) ; } @@ -53,5 +54,8 @@ void LClock::updateFormats(){ datefmt = LSession::handle()->sessionSettings()->value("DateFormat","").toString(); deftime = timefmt.simplified().isEmpty(); defdate = datefmt.simplified().isEmpty(); + useTZ = LSession::handle()->sessionSettings()->value("CustomTimeZone",false).toBool(); + if(useTZ){ TZ = QTimeZone( LSession::handle()->sessionSettings()->value("TimeZoneByteCode", QByteArray()).toByteArray() ); } + } diff --git a/lumina-desktop/panel-plugins/clock/LClock.h b/lumina-desktop/panel-plugins/clock/LClock.h index 1e4c8294..8156e7d8 100644 --- a/lumina-desktop/panel-plugins/clock/LClock.h +++ b/lumina-desktop/panel-plugins/clock/LClock.h @@ -13,6 +13,7 @@ #include <QWidget> #include <QString> #include <QLocale> +#include <QTimeZone> #include "../LPPlugin.h" @@ -26,7 +27,8 @@ private: QTimer *timer; QLabel *labelWidget; QString timefmt, datefmt; - bool deftime, defdate; + bool deftime, defdate, useTZ; + QTimeZone TZ; private slots: void updateTime(); |