summaryrefslogtreecommitdiffstats
path: root/src/corelib/plugin/qlibrary.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/plugin/qlibrary.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/plugin/qlibrary.cpp')
-rw-r--r--src/corelib/plugin/qlibrary.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index fbeddf0bb0..1fdc05afeb 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -68,6 +68,8 @@
QT_BEGIN_NAMESPACE
+using namespace Qt::StringLiterals;
+
// On Unix systema and on Windows with MinGW, we can mix and match debug and
// release plugins without problems. (unless compiled in debug-and-release mode
// - why?)
@@ -628,11 +630,11 @@ QtPluginInstanceFunction QLibraryPrivate::loadPlugin()
bool QLibrary::isLibrary(const QString &fileName)
{
#if defined(Q_OS_WIN)
- return fileName.endsWith(QLatin1String(".dll"), Qt::CaseInsensitive);
+ return fileName.endsWith(".dll"_L1, Qt::CaseInsensitive);
#else // Generic Unix
# if defined(Q_OS_DARWIN)
// On Apple platforms, dylib look like libmylib.1.0.0.dylib
- if (fileName.endsWith(QLatin1String(".dylib")))
+ if (fileName.endsWith(".dylib"_L1))
return true;
# endif
QString completeSuffix = QFileInfo(fileName).completeSuffix();
@@ -647,18 +649,18 @@ bool QLibrary::isLibrary(const QString &fileName)
"In PA-RISC (PA-32 and PA-64) shared libraries are suffixed with .sl. In IPF (32-bit and 64-bit),
the shared libraries are suffixed with .so. For compatibility, the IPF linker also supports the .sl suffix."
*/
- QLatin1String("sl"),
+ "sl"_L1,
# if defined __ia64
- QLatin1String("so"),
+ "so"_L1,
# endif
# elif defined(Q_OS_AIX)
- QLatin1String("a"),
- QLatin1String("so"),
+ "a"_L1,
+ "so"_L1,
# elif defined(Q_OS_DARWIN)
- QLatin1String("so"),
- QLatin1String("bundle"),
+ "so"_L1,
+ "bundle"_L1,
# elif defined(Q_OS_UNIX)
- QLatin1String("so"),
+ "so"_L1,
# endif
}; // candidates
@@ -741,7 +743,7 @@ void QLibraryPrivate::updatePluginState()
bool success = false;
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
- if (fileName.endsWith(QLatin1String(".debug"))) {
+ if (fileName.endsWith(".debug"_L1)) {
// refuse to load a file that ends in .debug
// these are the debug symbols from the libraries
// the problem is that they are valid shared library files
@@ -789,7 +791,7 @@ void QLibraryPrivate::updatePluginState()
QString::number((qt_version & 0xff0000) >> 16),
QString::number((qt_version & 0xff00) >> 8),
QString::number(qt_version & 0xff),
- debug ? QLatin1String("debug") : QLatin1String("release"));
+ debug ? "debug"_L1 : "release"_L1);
} else if (PluginMustMatchQtDebug && debug != QtBuildIsDebug) {
//don't issue a qWarning since we will hopefully find a non-debug? --Sam
errorString = QLibrary::tr("The plugin '%1' uses incompatible Qt library."