Commit 5094b7e0 authored by Jonah Brüchert's avatar Jonah Brüchert 🌳 Committed by Nicolas Fella

mobile filechooser: Make sure to also return the right folder when the folder wasn't changed

parent 2f254a3b
......@@ -115,7 +115,13 @@ Kirigami.ScrollablePage {
text: root.acceptLabel ? root.acceptLabel : i18n("Select")
icon.name: "dialog-ok"
onTriggered: root.accepted(root.fileUrls)
onTriggered: {
if (root.selectFolder) {
root.accepted([dirModel.folder])
} else {
root.accepted(root.fileUrls)
}
}
}
DirModel {
......@@ -156,14 +162,6 @@ Kirigami.ScrollablePage {
if (root.selectExisting) {
// The delegate being clicked on represents a directory
if (isDir) {
// If we want to select a folder,
// store the folder being clicked on in the output variable,
// so it is ready once accepted() is emitted by pressing
// the corrosponding button
if (root.selectFolder) {
root.fileUrls = [url]
}
// Change into folder
dirModel.folder = url
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment