From 894322a3a1d9c098a76cf2eec97a05f30a74dfe9 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sat, 18 Aug 2018 08:11:48 +0200 Subject: Hopefully fixed file dialogs on mac. There seems to be a problem with setting visible=true before the component is completed. The dialog doesn't have to wrapped in a component anyways, and we can just show it using open. --- views/composer/qml/View.qml | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'views/composer/qml') diff --git a/views/composer/qml/View.qml b/views/composer/qml/View.qml index de3a6a5b..9e390156 100644 --- a/views/composer/qml/View.qml +++ b/views/composer/qml/View.qml @@ -348,23 +348,19 @@ Kube.View { text: qsTr("Attach file") onClicked: { - fileDialogComponent.createObject(parent) + fileDialog.open() } - Component { - id: fileDialogComponent - Dialogs.FileDialog { - id: fileDialog - visible: true - title: qsTr("Choose a file to attach") - folder: shortcuts.home - selectFolder: false - selectExisting: true - selectMultiple: true - onAccepted: { - for (var i = 0; i < fileDialog.fileUrls.length; ++i) { - composerController.attachments.add({url: fileDialog.fileUrls[i]}) - } + Dialogs.FileDialog { + id: fileDialog + title: qsTr("Choose a file to attach") + folder: shortcuts.home + selectFolder: false + selectExisting: true + selectMultiple: true + onAccepted: { + for (var i = 0; i < fileDialog.fileUrls.length; ++i) { + composerController.attachments.add({url: fileDialog.fileUrls[i]}) } } } -- cgit v1.2.3