summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorsanevala <samuel.nevala@digia.com>2013-02-12 12:18:24 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-02-19 13:50:36 +0100
commitc42e7baac98ba4c3db8995ac37c5d020b57b9df7 (patch)
tree100174a55a1ec618ca89fb1bd51c28a4832f9875 /examples
parent5b57edae2aaca50d0c2642908046ad21ef956720 (diff)
User is not able to select file from FileBrowser and play it.
When string is converted to Url qrc:// scheme is used. Fix Filebrowser to use file:// scheme instead. Change-Id: I713e704eb52d27d046ace1ff7d65feb98635461d Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/multimedia/video/qmlvideofx/main.cpp17
-rw-r--r--examples/multimedia/video/qmlvideofx/qml/qmlvideofx/FileBrowser.qml5
2 files changed, 14 insertions, 8 deletions
diff --git a/examples/multimedia/video/qmlvideofx/main.cpp b/examples/multimedia/video/qmlvideofx/main.cpp
index c0490e688..ab613daa8 100644
--- a/examples/multimedia/video/qmlvideofx/main.cpp
+++ b/examples/multimedia/video/qmlvideofx/main.cpp
@@ -116,16 +116,21 @@ int main(int argc, char *argv[])
FileReader fileReader;
viewer.rootContext()->setContextProperty("fileReader", &fileReader);
- QString imagePath = "../../images";
+ QUrl appPath(QString("file:///%1").arg(app.applicationDirPath()));
+ QUrl imagePath;
const QStringList picturesLocation = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation);
- if (!picturesLocation.isEmpty())
- imagePath = picturesLocation.first();
+ if (picturesLocation.isEmpty())
+ imagePath = appPath.resolved(QUrl("images"));
+ else
+ imagePath = QString("file:///%1").arg(picturesLocation.first());
viewer.rootContext()->setContextProperty("imagePath", imagePath);
- QString videoPath;
+ QUrl videoPath;
const QStringList moviesLocation = QStandardPaths::standardLocations(QStandardPaths::MoviesLocation);
- if (!moviesLocation.isEmpty())
- videoPath = moviesLocation.first();
+ if (moviesLocation.isEmpty())
+ videoPath = appPath.resolved(QUrl("./"));
+ else
+ videoPath = QString("file:///%1").arg(moviesLocation.first());
viewer.rootContext()->setContextProperty("videoPath", videoPath);
viewer.setTitle("qmlvideofx");
diff --git a/examples/multimedia/video/qmlvideofx/qml/qmlvideofx/FileBrowser.qml b/examples/multimedia/video/qmlvideofx/qml/qmlvideofx/FileBrowser.qml
index e3de7e6e8..d61d35a14 100644
--- a/examples/multimedia/video/qmlvideofx/qml/qmlvideofx/FileBrowser.qml
+++ b/examples/multimedia/video/qmlvideofx/qml/qmlvideofx/FileBrowser.qml
@@ -101,10 +101,11 @@ Rectangle {
Rectangle {
id: wrapper
function launch() {
+ var path = "file:///" + filePath
if (folders.isFolder(index))
- down(filePath);
+ down(path);
else
- fileBrowser.selectFile(filePath)
+ fileBrowser.selectFile(path)
}
width: root.width
height: 52