From 27274d4c913d0b7b5cfece0f5e5b14c278f063f9 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Wed, 5 Oct 2016 15:26:25 +0200 Subject: [PATCH 08/19] [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 8436796..889e038 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; -- 2.7.4