diff --git a/linphone-desktop/ui/modules/Common/Form/Buttons/FileChooserButton.qml b/linphone-desktop/ui/modules/Common/Form/Buttons/FileChooserButton.qml index 2e20a817c..018d881ab 100644 --- a/linphone-desktop/ui/modules/Common/Form/Buttons/FileChooserButton.qml +++ b/linphone-desktop/ui/modules/Common/Form/Buttons/FileChooserButton.qml @@ -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()