Fix file dialog usage in app and plasmoid
fileDialog.open() does *not* block, so we need to move the sending to onAccepted. Not sure why I thought this ever worked. BUG: 423975
This commit is contained in:
parent
6cbaaa1a80
commit
198789e6fc
2 changed files with 5 additions and 11 deletions
|
@ -105,13 +105,9 @@ Kirigami.ScrollablePage
|
||||||
device: root.currentDevice
|
device: root.currentDevice
|
||||||
},
|
},
|
||||||
PluginItem {
|
PluginItem {
|
||||||
readonly property var shareIface: ShareDbusInterfaceFactory.create(root.currentDevice.id())
|
|
||||||
pluginName: "share"
|
pluginName: "share"
|
||||||
name: i18nd("kdeconnect-app", "Share File")
|
name: i18nd("kdeconnect-app", "Share File")
|
||||||
onClick: () => {
|
onClick: () => fileDialog.open()
|
||||||
fileDialog.open()
|
|
||||||
shareIface.shareUrl(fileDialog.fileUrl)
|
|
||||||
}
|
|
||||||
device: root.currentDevice
|
device: root.currentDevice
|
||||||
},
|
},
|
||||||
PluginItem {
|
PluginItem {
|
||||||
|
@ -169,7 +165,9 @@ Kirigami.ScrollablePage
|
||||||
|
|
||||||
FileDialog {
|
FileDialog {
|
||||||
id: fileDialog
|
id: fileDialog
|
||||||
|
readonly property var shareIface: ShareDbusInterfaceFactory.create(root.currentDevice.id())
|
||||||
title: i18nd("kdeconnect-app", "Please choose a file")
|
title: i18nd("kdeconnect-app", "Please choose a file")
|
||||||
folder: shortcuts.home
|
folder: shortcuts.home
|
||||||
|
onAccepted: shareIface.shareUrl(fileDialog.fileUrl)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,18 +105,14 @@ PlasmaComponents.ListItem
|
||||||
title: i18n("Please choose a file")
|
title: i18n("Please choose a file")
|
||||||
folder: shortcuts.home
|
folder: shortcuts.home
|
||||||
selectMultiple: true
|
selectMultiple: true
|
||||||
|
onAccepted: fileDialog.fileUrls.forEach(url => share.plugin.shareUrl(url))
|
||||||
}
|
}
|
||||||
|
|
||||||
id: shareFile
|
id: shareFile
|
||||||
icon: "document-share"
|
icon: "document-share"
|
||||||
visible: share.available
|
visible: share.available
|
||||||
text: i18n("Share file")
|
text: i18n("Share file")
|
||||||
onClicked: {
|
onClicked: fileDialog.open()
|
||||||
fileDialog.open()
|
|
||||||
fileDialog.fileUrls.forEach(function (url) {
|
|
||||||
share.plugin.shareUrl(url)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Find my phone
|
//Find my phone
|
||||||
|
|
Loading…
Reference in a new issue