diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2013-07-31 11:15:25 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-19 10:07:19 +0200 |
commit | c86d14a380118bc530547c69ba982d2c5e04a992 (patch) | |
tree | 9b7c5ba984851c1c8ba1dbb5be24445762d4d495 /examples/multimedia/video/qmlvideofx/qml/qmlvideofx/FileBrowser.qml | |
parent | 188b59609b1c01792b63e02e8c230616b93f5c51 (diff) |
Fix file browser in qmlvideofx example.
Similar to de9092389f2e43370c2cfcd6759d08cc11da9a68 for qmlvideo.
Use QUrl::fromLocalFile() to get Windows drive handling
right. Emulate its behavior in QML code. Fix up() to terminate
correctly.
Task-number: QTBUG-32139
Change-Id: I36bafaa608ff054190dc76694f6254a74f3b513e
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
Diffstat (limited to 'examples/multimedia/video/qmlvideofx/qml/qmlvideofx/FileBrowser.qml')
-rw-r--r-- | examples/multimedia/video/qmlvideofx/qml/qmlvideofx/FileBrowser.qml | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/examples/multimedia/video/qmlvideofx/qml/qmlvideofx/FileBrowser.qml b/examples/multimedia/video/qmlvideofx/qml/qmlvideofx/FileBrowser.qml index 3d4343c25..7c8610361 100644 --- a/examples/multimedia/video/qmlvideofx/qml/qmlvideofx/FileBrowser.qml +++ b/examples/multimedia/video/qmlvideofx/qml/qmlvideofx/FileBrowser.qml @@ -102,7 +102,10 @@ Rectangle { Rectangle { id: wrapper function launch() { - var path = "file://" + filePath + var path = "file://"; + if (filePath.length > 2 && filePath[1] === ':') // Windows drive logic, see QUrl::fromLocalFile() + path += '/'; + path += filePath; if (folders.isFolder(index)) down(path); else @@ -307,7 +310,7 @@ Rectangle { MouseArea { id: upRegion; anchors.centerIn: parent width: 56 height: 56 - onClicked: if (folders.parentFolder != "") up() + onClicked: up() } states: [ State { @@ -353,6 +356,8 @@ Rectangle { function up() { var path = folders.parentFolder; + if (path.toString().length === 0 || path.toString() === 'file:') + return; if (folders == folders1) { view = view2 folders = folders2; |