summaryrefslogtreecommitdiffstats
path: root/examples/multimedia/video/qmlvideo/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/multimedia/video/qmlvideo/main.cpp')
-rw-r--r--examples/multimedia/video/qmlvideo/main.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/examples/multimedia/video/qmlvideo/main.cpp b/examples/multimedia/video/qmlvideo/main.cpp
index ac26c983a..1a9c52391 100644
--- a/examples/multimedia/video/qmlvideo/main.cpp
+++ b/examples/multimedia/video/qmlvideo/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
@@ -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");