From 3fbc9aad103d684efb0cb7b86fdc2965c4746adc Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 5 Oct 2016 09:56:39 +0200 Subject: [PATCH 1/3] 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 --- .../digital-clock/package/contents/ui/main.qml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/applets/digital-clock/package/contents/ui/main.qml b/applets/digital-clock/package/contents/ui/main.qml index ca22e0515..f117ea45c 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 } From f3a8845028245baa5397646b78203913f4a5d16d Mon Sep 17 00:00:00 2001 From: l10n daemon script Date: Wed, 5 Oct 2016 12:01:07 +0000 Subject: [PATCH 2/3] SVN_SILENT made messages (.desktop file) - always resolve ours In case of conflict in i18n, keep the version of the branch "ours" To resolve a particular conflict, "git checkout --ours path/to/file.desktop" --- templates/ion-dataengine/ion-dataengine.kdevtemplate | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/ion-dataengine/ion-dataengine.kdevtemplate b/templates/ion-dataengine/ion-dataengine.kdevtemplate index 7e6ba587e..35b521cde 100644 --- a/templates/ion-dataengine/ion-dataengine.kdevtemplate +++ b/templates/ion-dataengine/ion-dataengine.kdevtemplate @@ -12,6 +12,7 @@ Name[sk]=Dátový engine Plasma Weather Ion Name[sv]=Plasma-datagränssnitt för väderjon Name[uk]=Рушій даних прогнозу погоди Плазми Ion Name[x-test]=xxPlasma Weather Ion Dataenginexx +Name[zh_CN]=Plasma 天气离子数据引擎 Comment=A special Plasma sub-dataengine for the Plasma Weather dataengine, providing access to one weather data service provider Comment[ca]=Un submotor de dades especial del Plasma pel motor de dades meteorològiques del Plasma Weather, que proporciona accés a un proveïdor del servei de dades meteorològiques Comment[ca@valencia]=Un submotor de dades especial del Plasma pel motor de dades meteorològiques del Plasma Weather, que proporciona accés a un proveïdor del servei de dades meteorològiques @@ -24,5 +25,6 @@ Comment[sk]=Špeciálny dátový engine Plasma pre dátový engine Plasma Weathe Comment[sv]=Ett särskilt undergränssnitt för Plasmas datagränssnitt för väder, som ger tillgång till en datatjänstleverantör av väder Comment[uk]=Спеціалізований допоміжний рушій даних Плазми для рушія даних прогнозу погоди, який надає доступ до даних одного з надавачів даних прогнозу погоди Comment[x-test]=xxA special Plasma sub-dataengine for the Plasma Weather dataengine, providing access to one weather data service providerxx +Comment[zh_CN]=一个特殊的 Plasma 子数据引擎,用于辅助 Plasma 天气数据引擎,提供了对一个天气数据服务提供商的访问功能 ShowFilesAfterGeneration=%{PROJECTDIR}/src/ion-%{APPNAMELC}.cpp Category=Plasma/Dataengine From 27274d4c913d0b7b5cfece0f5e5b14c278f063f9 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Wed, 5 Oct 2016 15:26:25 +0200 Subject: [PATCH 3/3] [Digital Clock] Silence warning BUG: 369734 FIXED-IN: 5.8.1 Differential Revision: https://phabricator.kde.org/D2922 --- applets/digital-clock/package/contents/ui/Tooltip.qml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/applets/digital-clock/package/contents/ui/Tooltip.qml b/applets/digital-clock/package/contents/ui/Tooltip.qml index 84367967f..889e03816 100644 --- a/applets/digital-clock/package/contents/ui/Tooltip.qml +++ b/applets/digital-clock/package/contents/ui/Tooltip.qml @@ -36,6 +36,11 @@ Item { LayoutMirroring.childrenInherit: true function timeForZone(zone) { + var compactRepresentationItem = plasmoid.compactRepresentationItem; + if (!compactRepresentationItem) { + return ""; + } + // get the time for the given timezone from the dataengine var now = dataSource.data[zone]["DateTime"]; // get current UTC time @@ -43,10 +48,10 @@ Item { // add the dataengine TZ offset to it var dateTime = new Date(msUTC + (dataSource.data[zone]["Offset"] * 1000)); - var formattedTime = Qt.formatTime(dateTime, plasmoid.compactRepresentationItem.timeFormat); + var formattedTime = Qt.formatTime(dateTime, compactRepresentationItem.timeFormat); if (dateTime.getDay() != dataSource.data["Local"]["DateTime"].getDay()) { - formattedTime += " (" + Qt.formatDate(dateTime, plasmoid.compactRepresentationItem.dateFormat) + ")"; + formattedTime += " (" + Qt.formatDate(dateTime, compactRepresentationItem.dateFormat) + ")"; } return formattedTime;