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/kernel/qsystemerror.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/kernel/qsystemerror.cpp')
-rw-r--r-- | src/corelib/kernel/qsystemerror.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/corelib/kernel/qsystemerror.cpp b/src/corelib/kernel/qsystemerror.cpp index 4be4874cf1..1aea501416 100644 --- a/src/corelib/kernel/qsystemerror.cpp +++ b/src/corelib/kernel/qsystemerror.cpp @@ -52,6 +52,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + #if !defined(Q_OS_WIN) && QT_CONFIG(thread) && !defined(Q_OS_INTEGRITY) && !defined(Q_OS_QNX) && \ defined(_POSIX_THREAD_SAFE_FUNCTIONS) && _POSIX_VERSION >= 200112L namespace { @@ -92,11 +94,11 @@ static QString windowsErrorString(int errorCode) if (ret.isEmpty() && errorCode == ERROR_MOD_NOT_FOUND) ret = QString::fromLatin1("The specified module could not be found."); - if (ret.endsWith(QLatin1String("\r\n"))) + if (ret.endsWith("\r\n"_L1)) ret.chop(2); if (ret.isEmpty()) ret = QString::fromLatin1("Unknown error 0x%1.") - .arg(unsigned(errorCode), 8, 16, QLatin1Char('0')); + .arg(unsigned(errorCode), 8, 16, '0'_L1); return ret; } #endif @@ -152,7 +154,7 @@ QString QSystemError::string(ErrorScope errorScope, int errorCode) qWarning("invalid error scope"); Q_FALLTHROUGH(); case NoError: - return QLatin1String("No error"); + return u"No error"_qs; } } |