From f12aa5d88f0ed05adf68aefaf094b19fe33e7fa8 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Tue, 13 Dec 2022 22:51:20 +0100 Subject: [PATCH] Fix qml warning Signed-off-by: Carl Schwan --- app/qml/DevicePage.qml | 6 +++--- app/qml/PluginInfoPage.qml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/qml/DevicePage.qml b/app/qml/DevicePage.qml index ed5c5a611..95a94c75e 100644 --- a/app/qml/DevicePage.qml +++ b/app/qml/DevicePage.qml @@ -116,7 +116,7 @@ Kirigami.ScrollablePage { Kirigami.PlaceholderMessage { text: i18nd("kdeconnect-app", "This device is not paired") anchors.centerIn: parent - visible: root.currentDevice.isReachable && !root.currentDevice.isTrusted && !root.currentDevice.hasPairingRequests + visible: root.currentDevice && root.currentDevice.isReachable && !root.currentDevice.isTrusted && !root.currentDevice.hasPairingRequests helpfulAction: Kirigami.Action { text: i18nd("kdeconnect-app", "Pair") icon.name:"network-connect" @@ -145,7 +145,7 @@ Kirigami.ScrollablePage { } Kirigami.PlaceholderMessage { - visible: !root.currentDevice.isReachable + visible: root.currentDevice && !root.currentDevice.isReachable text: i18nd("kdeconnect-app", "This device is not reachable") anchors.centerIn: parent } @@ -153,7 +153,7 @@ Kirigami.ScrollablePage { FileDialog { id: fileDialog - readonly property var shareIface: ShareDbusInterfaceFactory.create(root.currentDevice.id()) + readonly property var shareIface: root.currentDevice ? ShareDbusInterfaceFactory.create(root.currentDevice.id()) : null title: i18nd("kdeconnect-app", "Please choose a file") folder: shortcuts.home onAccepted: shareIface.shareUrl(fileDialog.fileUrl) diff --git a/app/qml/PluginInfoPage.qml b/app/qml/PluginInfoPage.qml index d43d0b970..a83e56e75 100644 --- a/app/qml/PluginInfoPage.qml +++ b/app/qml/PluginInfoPage.qml @@ -12,7 +12,7 @@ Kirigami.Page { property string configFile property string device - actions.main: loader.item.action + actions.main: loader.item && loader.item.action ? loader.item.action : null onConfigFileChanged: loader.setSource(configFile, { device: root.device