rootObject, SLOT(qmlFramePainted()));
#endif
- QUrl videoPath;
const QStringList moviesLocation = QStandardPaths::standardLocations(QStandardPaths::MoviesLocation);
- if (moviesLocation.isEmpty()) {
- QUrl appPath(QString("file://%1").arg(app.applicationDirPath()));
- videoPath = appPath.resolved(QUrl("./"));
- } else
- videoPath = QString("file://%1").arg(moviesLocation.first());
+ const QUrl videoPath =
+ QUrl::fromLocalFile(moviesLocation.isEmpty() ?
+ app.applicationDirPath() :
+ moviesLocation.front());
viewer.rootContext()->setContextProperty("videoPath", videoPath);
QMetaObject::invokeMethod(rootObject, "init");
Rectangle {
id: wrapper
function launch() {
- var path = "file://" + filePath;
+ console.debug("launch " + filePath);
+ var path = "file://";
+ if (filePath.length > 2 && filePath[1] === ':') // Windows drive logic, see QUrl::fromLocalFile()
+ path += '/';
+ path += filePath;
if (folders.isFolder(index))
down(path);
else
MouseArea { id: upRegion; anchors.centerIn: parent
width: 56
height: 56
- onClicked: if (folders.parentFolder != "") up()
+ onClicked: up()
}
states: [
State {
function up() {
var path = folders.parentFolder;
+ if (path.toString().length === 0 || path.toString() === 'file:')
+ return;
if (folders == folders1) {
view = view2
folders = folders2;