summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfileselector.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/io/qfileselector.cpp')
-rw-r--r--src/corelib/io/qfileselector.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/corelib/io/qfileselector.cpp b/src/corelib/io/qfileselector.cpp
index 9cca3793a2..a84a03837d 100644
--- a/src/corelib/io/qfileselector.cpp
+++ b/src/corelib/io/qfileselector.cpp
@@ -229,9 +229,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;
}
@@ -250,9 +250,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()));
}