diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2014-01-13 15:16:01 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-06 09:48:26 +0100 |
commit | a67cf8bd31d3ea88729b704b58f3490c2a8ea7d2 (patch) | |
tree | ad9df6569e2d62728d466441ca73fc52c2a786d3 /src/dialogs/DefaultFileDialog.qml | |
parent | ce295650145c06851388ad0ec7f384a53fc6c036 (diff) | |
download | qtquickcontrols-a67cf8bd31d3ea88729b704b58f3490c2a8ea7d2.tar.gz |
QtQuick.Dialogs FileDialog: don't go astray into qrc:/ on Android
Was due to string->URL conversion when setting FolderListModel.folder.
Task-number: QTBUG-36006
Change-Id: Ia768d8a5473b3d4c22ef9be7c8b3cf28d3956f6f
(cherry picked from qtdeclarative/cf2b04f6da6fb4d6a7da924a0796bfa8fda25398)
Reviewed-by: Liang Qi <liang.qi@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/dialogs/DefaultFileDialog.qml')
-rw-r--r-- | src/dialogs/DefaultFileDialog.qml | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/dialogs/DefaultFileDialog.qml b/src/dialogs/DefaultFileDialog.qml index 9967fce6..06e68059 100644 --- a/src/dialogs/DefaultFileDialog.qml +++ b/src/dialogs/DefaultFileDialog.qml @@ -54,7 +54,13 @@ AbstractFileDialog { currentPathField.visible = false } } - onFolderChanged: view.model.folder = folder + onFolderChanged: { + var str = new String(folder) + if (str.indexOf("qrc:") === 0) + folder = "file:" + str.slice(4) + if (view.model.folder != folder) + view.model.folder = folder + } property real __textX: titleBar.height property SystemPalette __palette @@ -62,12 +68,15 @@ AbstractFileDialog { property int __lastClickedIdx: -1 function __dirDown(path) { - view.model.folder = path + view.model.folder = "file://" + path __lastClickedIdx = -1 __selectedIndices = [] } function __dirUp() { - view.model.folder = view.model.parentFolder + if (view.model.parentFolder == "") + view.model.folder = "file:///" + else + view.model.folder = view.model.parentFolder __lastClickedIdx = -1 __selectedIndices = [] } |