[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [plasma-workspace] applets/digital-clock/package/contents/ui: always connect to "Local" source
From:       Marco Martin <notmart () gmail ! com>
Date:       2016-10-05 7:56:54
Message-ID: E1brh4Q-0002jB-Vi () code ! kde ! org
[Download RAW message or body]

Git commit a925224e40c6df3155a045df40db25061179f6c7 by Marco Martin.
Committed on 05/10/2016 at 07:56.
Pushed by mart into branch 'master'.

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

M  +16   -1    applets/digital-clock/package/contents/ui/main.qml

http://commits.kde.org/plasma-workspace/a925224e40c6df3155a045df40db25061179f6c7

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  }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic