diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-04-13 16:44:37 +0200 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-04-14 15:29:06 +0200 |
commit | b28ed7fdc23e152e646c36e218aa41f05adb28ec (patch) | |
tree | 165c43702c545bf4a72d155275010459daadf5fc /src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp | |
parent | d0a08d1f1176f00a8f3dde8dba49f139ab1e2535 (diff) |
Android: use _L1 for for creating Latin-1 string literals
Task-number: QTBUG-98434
Change-Id: I5ee5fe079c9a4530f636e59f6171abfa523591f4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Diffstat (limited to 'src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp')
-rw-r--r-- | src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp b/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp index 21feb91339..d82cdd02d5 100644 --- a/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp +++ b/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp @@ -49,14 +49,16 @@ QT_BEGIN_NAMESPACE -static const QLatin1String assetsPrefix("assets:"); +using namespace Qt::StringLiterals; + +static const auto assetsPrefix = "assets:"_L1; const static int prefixSize = 7; static inline QString cleanedAssetPath(QString file) { if (file.startsWith(assetsPrefix)) file.remove(0, prefixSize); - file.replace(QLatin1String("//"), QLatin1String("/")); + file.replace("//"_L1, "/"_L1); if (file.startsWith(u'/')) file.remove(0, 1); if (file.endsWith(u'/')) @@ -67,7 +69,7 @@ static inline QString cleanedAssetPath(QString file) static inline QString prefixedPath(QString path) { path = assetsPrefix + u'/' + path; - path.replace(QLatin1String("//"), QLatin1String("/")); + path.replace("//"_L1, "/"_L1); return path; } @@ -157,7 +159,7 @@ public: } } m_path = assetsPrefix + u'/' + m_path + u'/'; - m_path.replace(QLatin1String("//"), QLatin1String("/")); + m_path.replace("//"_L1, "/"_L1); } QString currentFileName() const @@ -381,7 +383,7 @@ private: AAsset *m_assetFile = nullptr; AAssetManager *m_assetManager = nullptr; // initialize with a name that can't be used as a file name - QString m_fileName = QLatin1String("."); + QString m_fileName = "."_L1; bool m_isFolder = false; }; @@ -400,7 +402,7 @@ QAbstractFileEngine * AndroidAssetsFileEngineHandler::create(const QString &file return nullptr; QString path = fileName.mid(prefixSize); - path.replace(QLatin1String("//"), QLatin1String("/")); + path.replace("//"_L1, "/"_L1); if (path.startsWith(u'/')) path.remove(0, 1); if (path.endsWith(u'/')) |