diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-03-09 16:34:49 +0100 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-03-25 19:16:29 +0100 |
commit | 753a08ae0e1204b148cf3935f87349eefe75d338 (patch) | |
tree | 193ff5b6a131bba519336c31727d708ddab43032 /src/corelib/io/qtemporarydir.cpp | |
parent | 1fefff6d1f99dbcf1a453424753ad5562fb675ef (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/qtemporarydir.cpp')
-rw-r--r-- | src/corelib/io/qtemporarydir.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/corelib/io/qtemporarydir.cpp b/src/corelib/io/qtemporarydir.cpp index c9573182c4..d19896563d 100644 --- a/src/corelib/io/qtemporarydir.cpp +++ b/src/corelib/io/qtemporarydir.cpp @@ -61,6 +61,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + static_assert(std::is_nothrow_move_constructible_v<QTemporaryDir>); static_assert(std::is_nothrow_move_assignable_v<QTemporaryDir>); @@ -95,9 +97,9 @@ static QString defaultTemplateName() baseName = QCoreApplication::applicationName(); if (baseName.isEmpty()) #endif - baseName = QLatin1String("qt_temp"); + baseName = "qt_temp"_L1; - return QDir::tempPath() + QLatin1Char('/') + baseName + QLatin1String("-XXXXXX"); + return QDir::tempPath() + u'/' + baseName + "-XXXXXX"_L1; } void QTemporaryDirPrivate::create(const QString &templateName) @@ -302,7 +304,7 @@ QString QTemporaryDir::filePath(const QString &fileName) const QString ret = d_ptr->pathOrError; if (!fileName.isEmpty()) { - ret += QLatin1Char('/'); + ret += u'/'; ret += fileName; } return ret; @@ -347,7 +349,7 @@ bool QTemporaryDir::remove() if (!d_ptr->success) return false; Q_ASSERT(!path().isEmpty()); - Q_ASSERT(path() != QLatin1String(".")); + Q_ASSERT(path() != "."_L1); const bool result = QDir(path()).removeRecursively(); if (!result) { |