Commit 6aaf2124 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/modules/Common/Form/Buttons/FileChooserButton): better file handling

parent 80f964b2
......@@ -71,16 +71,24 @@ TextField {
id: fileDialog
folder: {
if (!textField.selectedFile.length) {
var selectedFile = textField.selectedFile
if (!selectedFile.length) {
return ''
}
return Utils.getUriFromSystemPath(Utils.dirname(textField.selectedFile))
return Utils.getUriFromSystemPath(
textField.selectFolder
? selectedFile
: Utils.dirname(selectedFile)
)
}
onAccepted: {
textField.selectedFile = Utils.getSystemPathFromUri(fileUrl)
textField.accepted(textField.selectedFile)
var selectedFile = Utils.getSystemPathFromUri(fileUrl)
textField.selectedFile = selectedFile
textField.accepted(selectedFile)
}
onRejected: textField.rejected()
......
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