Fix qml warning

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
This commit is contained in:
Carl Schwan 2022-12-13 22:51:20 +01:00
parent b55013f57a
commit f12aa5d88f
2 changed files with 4 additions and 4 deletions

View file

@ -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)

View file

@ -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