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>
This commit is contained in:
@@ -116,16 +116,21 @@ int main(int argc, char *argv[])
|
|||||||
FileReader fileReader;
|
FileReader fileReader;
|
||||||
viewer.rootContext()->setContextProperty("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);
|
const QStringList picturesLocation = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation);
|
||||||
if (!picturesLocation.isEmpty())
|
if (picturesLocation.isEmpty())
|
||||||
imagePath = picturesLocation.first();
|
imagePath = appPath.resolved(QUrl("images"));
|
||||||
|
else
|
||||||
|
imagePath = QString("file:///%1").arg(picturesLocation.first());
|
||||||
viewer.rootContext()->setContextProperty("imagePath", imagePath);
|
viewer.rootContext()->setContextProperty("imagePath", imagePath);
|
||||||
|
|
||||||
QString videoPath;
|
QUrl videoPath;
|
||||||
const QStringList moviesLocation = QStandardPaths::standardLocations(QStandardPaths::MoviesLocation);
|
const QStringList moviesLocation = QStandardPaths::standardLocations(QStandardPaths::MoviesLocation);
|
||||||
if (!moviesLocation.isEmpty())
|
if (moviesLocation.isEmpty())
|
||||||
videoPath = moviesLocation.first();
|
videoPath = appPath.resolved(QUrl("./"));
|
||||||
|
else
|
||||||
|
videoPath = QString("file:///%1").arg(moviesLocation.first());
|
||||||
viewer.rootContext()->setContextProperty("videoPath", videoPath);
|
viewer.rootContext()->setContextProperty("videoPath", videoPath);
|
||||||
|
|
||||||
viewer.setTitle("qmlvideofx");
|
viewer.setTitle("qmlvideofx");
|
||||||
|
|||||||
@@ -101,10 +101,11 @@ Rectangle {
|
|||||||
Rectangle {
|
Rectangle {
|
||||||
id: wrapper
|
id: wrapper
|
||||||
function launch() {
|
function launch() {
|
||||||
|
var path = "file:///" + filePath
|
||||||
if (folders.isFolder(index))
|
if (folders.isFolder(index))
|
||||||
down(filePath);
|
down(path);
|
||||||
else
|
else
|
||||||
fileBrowser.selectFile(filePath)
|
fileBrowser.selectFile(path)
|
||||||
}
|
}
|
||||||
width: root.width
|
width: root.width
|
||||||
height: 52
|
height: 52
|
||||||
|
|||||||
Reference in New Issue
Block a user