summaryrefslogtreecommitdiffstats
path: root/src/corelib/plugin/qpluginloader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/plugin/qpluginloader.cpp')
-rw-r--r--src/corelib/plugin/qpluginloader.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/corelib/plugin/qpluginloader.cpp b/src/corelib/plugin/qpluginloader.cpp
index 24101be87b..af6e3e0e93 100644
--- a/src/corelib/plugin/qpluginloader.cpp
+++ b/src/corelib/plugin/qpluginloader.cpp
@@ -41,10 +41,10 @@
#include "qdebug.h"
#include "qdir.h"
-#ifndef QT_NO_LIBRARY
-
QT_BEGIN_NAMESPACE
+#ifndef QT_NO_LIBRARY
+
/*!
\class QPluginLoader
\inmodule QtCore
@@ -300,9 +300,9 @@ static QString locatePlugin(const QString& fileName)
paths.prepend(QStringLiteral(".")); // search in current dir first
}
- foreach (const QString &path, paths) {
- foreach (const QString &prefix, prefixes) {
- foreach (const QString &suffix, suffixes) {
+ for (const QString &path : qAsConst(paths)) {
+ for (const QString &prefix : qAsConst(prefixes)) {
+ for (const QString &suffix : qAsConst(suffixes)) {
const QString fn = path + QLatin1Char('/') + basePath + prefix + baseName + suffix;
if (debug)
qDebug() << "Trying..." << fn;
@@ -382,9 +382,6 @@ QString QPluginLoader::errorString() const
return (!d || d->errorString.isEmpty()) ? tr("Unknown error") : d->errorString;
}
-typedef QVector<QStaticPlugin> StaticPluginList;
-Q_GLOBAL_STATIC(StaticPluginList, staticPluginList)
-
/*! \since 4.4
\property QPluginLoader::loadHints
@@ -413,6 +410,11 @@ QLibrary::LoadHints QPluginLoader::loadHints() const
return d ? d->loadHints() : QLibrary::LoadHints();
}
+#endif // QT_NO_LIBRARY
+
+typedef QVector<QStaticPlugin> StaticPluginList;
+Q_GLOBAL_STATIC(StaticPluginList, staticPluginList)
+
/*!
\relates QPluginLoader
\since 5.0
@@ -465,9 +467,8 @@ QVector<QStaticPlugin> QPluginLoader::staticPlugins()
*/
QJsonObject QStaticPlugin::metaData() const
{
- return QLibraryPrivate::fromRawMetaData(rawMetaData()).object();
+ return qJsonFromRawLibraryMetaData(rawMetaData()).object();
}
QT_END_NAMESPACE
-#endif // QT_NO_LIBRARY