From 198789e6fcd7eee2a8c29643c16f67055421b9ee Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Wed, 8 Jul 2020 20:09:35 +0200 Subject: [PATCH] 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 --- app/qml/DevicePage.qml | 8 +++----- plasmoid/package/contents/ui/DeviceDelegate.qml | 8 ++------ 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/app/qml/DevicePage.qml b/app/qml/DevicePage.qml index 29d026b45..345eda24d 100644 --- a/app/qml/DevicePage.qml +++ b/app/qml/DevicePage.qml @@ -105,13 +105,9 @@ Kirigami.ScrollablePage device: root.currentDevice }, PluginItem { - readonly property var shareIface: ShareDbusInterfaceFactory.create(root.currentDevice.id()) pluginName: "share" name: i18nd("kdeconnect-app", "Share File") - onClick: () => { - fileDialog.open() - shareIface.shareUrl(fileDialog.fileUrl) - } + onClick: () => fileDialog.open() device: root.currentDevice }, PluginItem { @@ -169,7 +165,9 @@ Kirigami.ScrollablePage FileDialog { id: fileDialog + readonly property var shareIface: ShareDbusInterfaceFactory.create(root.currentDevice.id()) title: i18nd("kdeconnect-app", "Please choose a file") folder: shortcuts.home + onAccepted: shareIface.shareUrl(fileDialog.fileUrl) } } diff --git a/plasmoid/package/contents/ui/DeviceDelegate.qml b/plasmoid/package/contents/ui/DeviceDelegate.qml index 56eaeeaa0..869a751a1 100644 --- a/plasmoid/package/contents/ui/DeviceDelegate.qml +++ b/plasmoid/package/contents/ui/DeviceDelegate.qml @@ -105,18 +105,14 @@ PlasmaComponents.ListItem title: i18n("Please choose a file") folder: shortcuts.home selectMultiple: true + onAccepted: fileDialog.fileUrls.forEach(url => share.plugin.shareUrl(url)) } id: shareFile icon: "document-share" visible: share.available text: i18n("Share file") - onClicked: { - fileDialog.open() - fileDialog.fileUrls.forEach(function (url) { - share.plugin.shareUrl(url) - }) - } + onClicked: fileDialog.open() } //Find my phone