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/main.cpp | |
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/main.cpp')
-rw-r--r-- | examples/multimedia/video/qmlvideofx/main.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/examples/multimedia/video/qmlvideofx/main.cpp b/examples/multimedia/video/qmlvideofx/main.cpp index b0698e236..7465deab8 100644 --- a/examples/multimedia/video/qmlvideofx/main.cpp +++ b/examples/multimedia/video/qmlvideofx/main.cpp @@ -116,21 +116,13 @@ int main(int argc, char *argv[]) FileReader fileReader; viewer.rootContext()->setContextProperty("fileReader", &fileReader); - QUrl appPath(QString("file://%1").arg(app.applicationDirPath())); - QUrl imagePath; + const QUrl appPath(QUrl::fromLocalFile(app.applicationDirPath())); const QStringList picturesLocation = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation); - if (picturesLocation.isEmpty()) - imagePath = appPath.resolved(QUrl("images")); - else - imagePath = QString("file://%1").arg(picturesLocation.first()); + const QUrl imagePath = picturesLocation.isEmpty() ? appPath : QUrl::fromLocalFile(picturesLocation.first()); viewer.rootContext()->setContextProperty("imagePath", imagePath); - QUrl videoPath; const QStringList moviesLocation = QStandardPaths::standardLocations(QStandardPaths::MoviesLocation); - if (moviesLocation.isEmpty()) - videoPath = appPath.resolved(QUrl("./")); - else - videoPath = QString("file://%1").arg(moviesLocation.first()); + const QUrl videoPath = moviesLocation.isEmpty() ? appPath : QUrl::fromLocalFile(moviesLocation.first()); viewer.rootContext()->setContextProperty("videoPath", videoPath); viewer.setTitle("qmlvideofx"); |