summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Martin <[email protected]>2016-10-05 09:56:39 +0200
committerMarco Martin <[email protected]>2016-10-05 09:56:48 +0200
commita925224e40c6df3155a045df40db25061179f6c7 (patch)
tree2fce267b9724cbfe6c48953f6c609e25abceac42
parent1531c7688315367963527706b3883b7ff91455a5 (diff)
always connect to "Local" source
Summary: We need Local to be *always* present, even if not disaplayed as it's used for formatting in ToolTip.dateTimeChanged() this makes sure local is always in the connected sources, even if it's not explicitly shown to the user Test Plan: tested, local timezone is not shown in clock/tooltip when selected, and no warnings from dateTimeChanged() Reviewers: #plasma, davidedmundson Reviewed By: #plasma, davidedmundson Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D2936
-rw-r--r--applets/digital-clock/package/contents/ui/main.qml17
1 files changed, 16 insertions, 1 deletions
diff --git a/applets/digital-clock/package/contents/ui/main.qml b/applets/digital-clock/package/contents/ui/main.qml
index ca22e05..f117ea4 100644
--- a/applets/digital-clock/package/contents/ui/main.qml
+++ b/applets/digital-clock/package/contents/ui/main.qml
@@ -56,10 +56,25 @@ Item {
source: "Tooltip.qml"
}
+ //We need Local to be *always* present, even if not disaplayed as
+ //it's used for formatting in ToolTip.dateTimeChanged()
+ property var allTimezones
+ Connections {
+ target: plasmoid.configuration
+ onSelectedTimeZonesChanged: {
+ var tz = Array()
+ if (plasmoid.configuration.selectedTimeZones.indexOf("Local") === -1) {
+ tz.push("Local");
+ }
+ root.allTimezones = tz.concat(plasmoid.configuration.selectedTimeZones);
+
+ }
+ }
+
PlasmaCore.DataSource {
id: dataSource
engine: "time"
- connectedSources: plasmoid.configuration.selectedTimeZones
+ connectedSources: allTimezones
interval: plasmoid.configuration.showSeconds ? 1000 : 60000
intervalAlignment: plasmoid.configuration.showSeconds ? PlasmaCore.Types.NoAlignment : PlasmaCore.Types.AlignToMinute
}