From 73859f6ec3d6dade4f375b68db3af8bb39b62496 Mon Sep 17 00:00:00 2001 From: sanevala Date: Tue, 12 Feb 2013 12:02:46 +0200 Subject: 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: I9617d9503ed403de7d017b8586ae37b05dc096cb Reviewed-by: Andy Nichols --- examples/multimedia/video/qmlvideo/main.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'examples/multimedia/video/qmlvideo/main.cpp') diff --git a/examples/multimedia/video/qmlvideo/main.cpp b/examples/multimedia/video/qmlvideo/main.cpp index e595e4fc8..1a9c52391 100644 --- a/examples/multimedia/video/qmlvideo/main.cpp +++ b/examples/multimedia/video/qmlvideo/main.cpp @@ -127,10 +127,13 @@ int main(int argc, char *argv[]) rootObject, SLOT(qmlFramePainted())); #endif - QString videoPath; + QUrl videoPath; const QStringList moviesLocation = QStandardPaths::standardLocations(QStandardPaths::MoviesLocation); - if (!moviesLocation.isEmpty()) - videoPath = moviesLocation.first(); + if (moviesLocation.isEmpty()) { + QUrl appPath(QString("file:///%1").arg(app.applicationDirPath())); + videoPath = appPath.resolved(QUrl("./")); + } else + videoPath = QString("file:///%1").arg(moviesLocation.first()); viewer.rootContext()->setContextProperty("videoPath", videoPath); QMetaObject::invokeMethod(rootObject, "init"); -- cgit v1.2.3