diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2016-01-26 11:27:37 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2016-01-26 11:27:37 +0000 |
commit | 0a1af55a9b69f7fd58dbce43a0d4c1faf0143838 (patch) | |
tree | 26da168e740734d168be37803abec2f8739b213d /src/corelib/io/qfileselector.cpp | |
parent | b8fb0ee999d32401157be8d86e5a03185aadbb9e (diff) | |
parent | 158a3a4159bdc5a49caecd63e021dacbc06cf23c (diff) |
Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/dev
Diffstat (limited to 'src/corelib/io/qfileselector.cpp')
-rw-r--r-- | src/corelib/io/qfileselector.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/corelib/io/qfileselector.cpp b/src/corelib/io/qfileselector.cpp index 10e59369e8..7a9a4b581c 100644 --- a/src/corelib/io/qfileselector.cpp +++ b/src/corelib/io/qfileselector.cpp @@ -230,9 +230,9 @@ QString QFileSelector::select(const QString &filePath) const static bool isLocalScheme(const QString &file) { - bool local = file == QStringLiteral("qrc"); + bool local = file == QLatin1String("qrc"); #ifdef Q_OS_ANDROID - local |= file == QStringLiteral("assets"); + local |= file == QLatin1String("assets"); #endif return local; } @@ -251,9 +251,16 @@ QUrl QFileSelector::select(const QUrl &filePath) const return filePath; QUrl ret(filePath); if (isLocalScheme(filePath.scheme())) { - QString equivalentPath = QLatin1Char(':') + filePath.path(); + QLatin1String scheme(":"); +#ifdef Q_OS_ANDROID + // use other scheme because ":" means "qrc" here + if (filePath.scheme() == QLatin1String("assets")) + scheme = QLatin1String("assets:"); +#endif + + QString equivalentPath = scheme + filePath.path(); QString selectedPath = d->select(equivalentPath); - ret.setPath(selectedPath.remove(0, 1)); + ret.setPath(selectedPath.remove(0, scheme.size())); } else { ret = QUrl::fromLocalFile(d->select(ret.toLocalFile())); } |