summaryrefslogtreecommitdiffstats
path: root/src/imports/dialogs/DefaultFileDialog.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/dialogs/DefaultFileDialog.qml')
-rw-r--r--src/imports/dialogs/DefaultFileDialog.qml17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/imports/dialogs/DefaultFileDialog.qml b/src/imports/dialogs/DefaultFileDialog.qml
index a43b493a29..2cdb34cc03 100644
--- a/src/imports/dialogs/DefaultFileDialog.qml
+++ b/src/imports/dialogs/DefaultFileDialog.qml
@@ -53,13 +53,13 @@ AbstractFileDialog {
currentPathField.visible = false
}
}
+ onFolderChanged: view.model.folder = folder
property bool showFocusHighlight: false
property real textX: titleBar.height
property SystemPalette palette
property var selectedIndices: []
property int lastClickedIdx: -1
- folder: urlToPath(view.model.folder)
function dirDown(path) {
view.model.folder = path
@@ -107,10 +107,11 @@ AbstractFileDialog {
selectedIndices.map(function(idx) {
if (view.model.isFolder(idx)) {
if (selectFolder)
- addSelection(view.model.get(idx, "filePath"))
+ // TODO after QTBUG-32039: should not need to convert pathToUrl here
+ addSelection(pathToUrl(view.model.get(idx, "filePath")))
} else {
if (!selectFolder)
- addSelection(view.model.get(idx, "filePath"))
+ addSelection(pathToUrl(view.model.get(idx, "filePath")))
}
})
}
@@ -211,7 +212,12 @@ AbstractFileDialog {
clip: true
x: 0
width: parent.width
- model: FolderListModel { }
+ model: FolderListModel {
+ onFolderChanged: {
+ root.folder = folder
+ currentPathField.text = root.urlToPath(view.model.folder)
+ }
+ }
delegate: folderDelegate
highlight: Rectangle {
color: "transparent"
@@ -305,10 +311,9 @@ AbstractFileDialog {
anchors.leftMargin: textX; anchors.rightMargin: 4
visible: false
focus: visible
- text: root.urlToPath(view.model.folder)
onAccepted: {
root.clearSelection()
- if (root.addSelection(text))
+ if (root.addSelection(root.pathToUrl(text)))
root.accept()
else
view.model.folder = root.pathFolder(text)