summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfileselector.cpp
diff options
context:
space:
mode:
authorBogDan Vatra <bogdan@kde.org>2015-05-12 09:37:52 +0300
committerBogDan Vatra <bogdan@kde.org>2015-05-13 04:30:25 +0000
commitc8db55970fecd5ee934c81bad12268c1760bfda7 (patch)
treea168bd438eb442f38d0d1b280ab72a8cfff082e0 /src/corelib/io/qfileselector.cpp
parent6e18f57a9c6810115ad7fba133bd53e7d460a265 (diff)
Consider "assets" scheme as a local file on Android
Task-number: QTBUG-46010 Change-Id: Icb6c5c2529b77e3967f6d23217e63e7773a5d706 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Diffstat (limited to 'src/corelib/io/qfileselector.cpp')
-rw-r--r--src/corelib/io/qfileselector.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/corelib/io/qfileselector.cpp b/src/corelib/io/qfileselector.cpp
index 4ca07ba41d..cddd70f908 100644
--- a/src/corelib/io/qfileselector.cpp
+++ b/src/corelib/io/qfileselector.cpp
@@ -225,9 +225,13 @@ QString QFileSelector::select(const QString &filePath) const
return d->select(filePath);
}
-static QString qrcScheme()
+static bool isLocalScheme(const QString &file)
{
- return QStringLiteral("qrc");
+ bool local = file == QStringLiteral("qrc");
+#ifdef Q_OS_ANDROID
+ local |= file == QStringLiteral("assets");
+#endif
+ return local;
}
/*!
@@ -240,10 +244,10 @@ static QString qrcScheme()
QUrl QFileSelector::select(const QUrl &filePath) const
{
Q_D(const QFileSelector);
- if (filePath.scheme() != qrcScheme() && !filePath.isLocalFile())
+ if (!isLocalScheme(filePath.scheme()) && !filePath.isLocalFile())
return filePath;
QUrl ret(filePath);
- if (filePath.scheme() == qrcScheme()) {
+ if (isLocalScheme(filePath.scheme())) {
QString equivalentPath = QLatin1Char(':') + filePath.path();
QString selectedPath = d->select(equivalentPath);
ret.setPath(selectedPath.remove(0, 1));