Fix for url bug in the qmlvideo examples.
authorChristian Strømme <christian.stromme@digia.com>
Wed, 12 Jun 2013 15:49:08 +0000 (17:49 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 13 Jun 2013 12:15:36 +0000 (14:15 +0200)
In the FileBrowser paths where being prepended with file:///, since all
the paths already starts with a forward slash, navigating away from the
initial directory was therefore not possible.

To make the examples work on Android, QT += multimedia was added.

Change-Id: Iff96729d476c4292999b022bdd6d5770b6b011e7
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
examples/multimedia/video/qmlvideo/main.cpp
examples/multimedia/video/qmlvideo/qml/qmlvideo/FileBrowser.qml
examples/multimedia/video/qmlvideo/qmlvideo.pro
examples/multimedia/video/qmlvideofx/main.cpp
examples/multimedia/video/qmlvideofx/qml/qmlvideofx/FileBrowser.qml
examples/multimedia/video/qmlvideofx/qmlvideofx.pro

index e44476a..81c38d2 100644 (file)
@@ -132,10 +132,10 @@ int main(int argc, char *argv[])
     QUrl videoPath;
     const QStringList moviesLocation = QStandardPaths::standardLocations(QStandardPaths::MoviesLocation);
     if (moviesLocation.isEmpty()) {
-        QUrl appPath(QString("file:///%1").arg(app.applicationDirPath()));
+        QUrl appPath(QString("file://%1").arg(app.applicationDirPath()));
         videoPath = appPath.resolved(QUrl("./"));
     } else
-        videoPath = QString("file:///%1").arg(moviesLocation.first());
+        videoPath = QString("file://%1").arg(moviesLocation.first());
     viewer.rootContext()->setContextProperty("videoPath", videoPath);
 
     QMetaObject::invokeMethod(rootObject, "init");
index 04f1092..18b7b0e 100644 (file)
@@ -101,7 +101,7 @@ Rectangle {
                 Rectangle {
                     id: wrapper
                     function launch() {
-                        var path = "file:///" + filePath;
+                        var path = "file://" + filePath;
                         if (folders.isFolder(index))
                             down(path);
                         else
index 3ea513d..26865c5 100644 (file)
@@ -1,7 +1,7 @@
 TEMPLATE = app
 TARGET = qmlvideo
 
-QT += quick
+QT += quick multimedia
 
 LOCAL_SOURCES = main.cpp
 LOCAL_HEADERS = trace.h
index ab613da..b0698e2 100644 (file)
@@ -116,13 +116,13 @@ int main(int argc, char *argv[])
     FileReader fileReader;
     viewer.rootContext()->setContextProperty("fileReader", &fileReader);
 
-    QUrl appPath(QString("file:///%1").arg(app.applicationDirPath()));
+    QUrl appPath(QString("file://%1").arg(app.applicationDirPath()));
     QUrl imagePath;
     const QStringList picturesLocation = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation);
     if (picturesLocation.isEmpty())
         imagePath = appPath.resolved(QUrl("images"));
     else
-        imagePath = QString("file:///%1").arg(picturesLocation.first());
+        imagePath = QString("file://%1").arg(picturesLocation.first());
     viewer.rootContext()->setContextProperty("imagePath", imagePath);
 
     QUrl videoPath;
@@ -130,7 +130,7 @@ int main(int argc, char *argv[])
     if (moviesLocation.isEmpty())
         videoPath = appPath.resolved(QUrl("./"));
     else
-        videoPath = QString("file:///%1").arg(moviesLocation.first());
+        videoPath = QString("file://%1").arg(moviesLocation.first());
     viewer.rootContext()->setContextProperty("videoPath", videoPath);
 
     viewer.setTitle("qmlvideofx");
index c089f6b..3d4343c 100644 (file)
@@ -102,7 +102,7 @@ Rectangle {
                 Rectangle {
                     id: wrapper
                     function launch() {
-                        var path = "file:///" + filePath
+                        var path = "file://" + filePath
                         if (folders.isFolder(index))
                             down(path);
                         else
index d62ade8..5634449 100644 (file)
@@ -1,7 +1,7 @@
 TEMPLATE = app
 TARGET = qmlvideofx
 
-QT += quick
+QT += quick multimedia
 
 SOURCES += filereader.cpp main.cpp
 HEADERS += filereader.h trace.h