diff options
Diffstat (limited to 'src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp')
-rw-r--r-- | src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp b/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp index 0c6fb92ffb..21feb91339 100644 --- a/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp +++ b/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp @@ -57,16 +57,16 @@ static inline QString cleanedAssetPath(QString file) if (file.startsWith(assetsPrefix)) file.remove(0, prefixSize); file.replace(QLatin1String("//"), QLatin1String("/")); - if (file.startsWith(QLatin1Char('/'))) + if (file.startsWith(u'/')) file.remove(0, 1); - if (file.endsWith(QLatin1Char('/'))) + if (file.endsWith(u'/')) file.chop(1); return file; } static inline QString prefixedPath(QString path) { - path = assetsPrefix + QLatin1Char('/') + path; + path = assetsPrefix + u'/' + path; path.replace(QLatin1String("//"), QLatin1String("/")); return path; } @@ -81,7 +81,7 @@ struct AssetItem { AssetItem (const QString &rawName) : name(rawName) { - if (name.endsWith(QLatin1Char('/'))) { + if (name.endsWith(u'/')) { type = Type::Folder; name.chop(1); } @@ -114,7 +114,7 @@ public: { if (filePath.isEmpty()) return AssetItem::Type::Folder; - const QStringList paths = filePath.split(QLatin1Char('/')); + const QStringList paths = filePath.split(u'/'); QString fullPath; AssetItem::Type res = AssetItem::Type::Invalid; for (const auto &path: paths) { @@ -125,7 +125,7 @@ public: if (it == folder->end() || it->name != path) return AssetItem::Type::Invalid; if (!fullPath.isEmpty()) - fullPath.append(QLatin1Char('/')); + fullPath.append(u'/'); fullPath += path; res = it->type; } @@ -156,7 +156,7 @@ public: }), item); } } - m_path = assetsPrefix + QLatin1Char('/') + m_path + QLatin1Char('/'); + m_path = assetsPrefix + u'/' + m_path + u'/'; m_path.replace(QLatin1String("//"), QLatin1String("/")); } @@ -329,21 +329,21 @@ public: QString fileName(FileName file = DefaultName) const override { - int pos; + qsizetype pos; switch (file) { case DefaultName: case AbsoluteName: case CanonicalName: return prefixedPath(m_fileName); case BaseName: - if ((pos = m_fileName.lastIndexOf(QChar(QLatin1Char('/')))) != -1) + if ((pos = m_fileName.lastIndexOf(u'/')) != -1) return prefixedPath(m_fileName.mid(pos)); else return prefixedPath(m_fileName); case PathName: case AbsolutePathName: case CanonicalPathName: - if ((pos = m_fileName.lastIndexOf(QChar(QLatin1Char('/')))) != -1) + if ((pos = m_fileName.lastIndexOf(u'/')) != -1) return prefixedPath(m_fileName.left(pos)); else return prefixedPath(m_fileName); @@ -401,9 +401,9 @@ QAbstractFileEngine * AndroidAssetsFileEngineHandler::create(const QString &file QString path = fileName.mid(prefixSize); path.replace(QLatin1String("//"), QLatin1String("/")); - if (path.startsWith(QLatin1Char('/'))) + if (path.startsWith(u'/')) path.remove(0, 1); - if (path.endsWith(QLatin1Char('/'))) + if (path.endsWith(u'/')) path.chop(1); return new AndroidAbstractFileEngine(m_assetManager, path); } |