summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfileselector.cpp
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2022-03-09 16:34:49 +0100
committerSona Kurazyan <sona.kurazyan@qt.io>2022-03-25 19:16:29 +0100
commit753a08ae0e1204b148cf3935f87349eefe75d338 (patch)
tree193ff5b6a131bba519336c31727d708ddab43032 /src/corelib/io/qfileselector.cpp
parent1fefff6d1f99dbcf1a453424753ad5562fb675ef (diff)
QtCore: replace QLatin1String/QLatin1Char with _L1/u'' where applicable
As a drive-by, did also minor refactorings/improvements. Task-number: QTBUG-98434 Change-Id: I81964176ae2f07ea63674c96f47f9c6aa046854f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Diffstat (limited to 'src/corelib/io/qfileselector.cpp')
-rw-r--r--src/corelib/io/qfileselector.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/corelib/io/qfileselector.cpp b/src/corelib/io/qfileselector.cpp
index dd6257a885..77362c2073 100644
--- a/src/corelib/io/qfileselector.cpp
+++ b/src/corelib/io/qfileselector.cpp
@@ -52,6 +52,8 @@
QT_BEGIN_NAMESPACE
+using namespace Qt::StringLiterals;
+
//Environment variable to allow tooling full control of file selectors
static const char env_override[] = "QT_NO_BUILTIN_SELECTORS";
@@ -196,9 +198,9 @@ QString QFileSelector::select(const QString &filePath) const
static bool isLocalScheme(const QString &file)
{
- bool local = file == QLatin1String("qrc");
+ bool local = file == "qrc"_L1;
#ifdef Q_OS_ANDROID
- local |= file == QLatin1String("assets");
+ local |= file == "assets"_L1;
#endif
return local;
}
@@ -217,11 +219,11 @@ QUrl QFileSelector::select(const QUrl &filePath) const
return filePath;
QUrl ret(filePath);
if (isLocalScheme(filePath.scheme())) {
- QLatin1String scheme(":");
+ auto scheme = ":"_L1;
#ifdef Q_OS_ANDROID
// use other scheme because ":" means "qrc" here
- if (filePath.scheme() == QLatin1String("assets"))
- scheme = QLatin1String("assets:");
+ if (filePath.scheme() == "assets"_L1)
+ scheme = "assets:"_L1;
#endif
QString equivalentPath = scheme + filePath.path();
@@ -250,13 +252,13 @@ QString QFileSelectorPrivate::selectionHelper(const QString &path, const QString
selector ordering in the API, we can stop checking as soon as we find the file in a directory
which does not contain any other valid selector directories.
*/
- Q_ASSERT(path.isEmpty() || path.endsWith(QLatin1Char('/')));
+ Q_ASSERT(path.isEmpty() || path.endsWith(u'/'));
for (const QString &s : selectors) {
QString prospectiveBase = path;
if (!indicator.isNull())
prospectiveBase += indicator;
- prospectiveBase += s + QLatin1Char('/');
+ prospectiveBase += s + u'/';
QStringList remainingSelectors = selectors;
remainingSelectors.removeAll(s);
if (!QDir(prospectiveBase).exists())
@@ -356,7 +358,7 @@ QStringList QFileSelectorPrivate::platformSelectors()
ret << QSysInfo::kernelType();
# endif
QString productName = QSysInfo::productType();
- if (productName != QLatin1String("unknown"))
+ if (productName != "unknown"_L1)
ret << productName; // "opensuse", "fedora", "osx", "ios", "android"
#endif
return ret;