summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qgenericpluginfactory.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2016-01-06 12:18:40 +0100
committerUlf Hermann <ulf.hermann@theqtcompany.com>2016-02-08 10:40:33 +0000
commit4fb7eb0da74798205f5cac693c921065492fa33e (patch)
tree2082182e4b640ef9233d1bd9108caccd30a5edb7 /src/gui/kernel/qgenericpluginfactory.cpp
parent21861e6fd1fcd1e4642f3d4c06ee7181d2c81778 (diff)
Drop most "#ifndef QT_NO_LIBRARY"
As we can load plugins without QLibrary now, we don't have to #ifdef out the code that does so anymore. Change-Id: I1dc20216830a882dbd5a1b431183407e6b19c837 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/kernel/qgenericpluginfactory.cpp')
-rw-r--r--src/gui/kernel/qgenericpluginfactory.cpp20
1 files changed, 1 insertions, 19 deletions
diff --git a/src/gui/kernel/qgenericpluginfactory.cpp b/src/gui/kernel/qgenericpluginfactory.cpp
index 442cff4cb7..9f41b948c0 100644
--- a/src/gui/kernel/qgenericpluginfactory.cpp
+++ b/src/gui/kernel/qgenericpluginfactory.cpp
@@ -46,16 +46,10 @@
QT_BEGIN_NAMESPACE
-#if !defined(Q_OS_WIN32) || defined(QT_SHARED)
-#ifndef QT_NO_LIBRARY
-
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QGenericPluginFactoryInterface_iid,
QLatin1String("/generic"), Qt::CaseInsensitive))
-#endif //QT_NO_LIBRARY
-#endif //QT_SHARED
-
/*!
\class QGenericPluginFactory
\ingroup plugins
@@ -75,15 +69,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
*/
QObject *QGenericPluginFactory::create(const QString& key, const QString &specification)
{
-#if (!defined(Q_OS_WIN32) || defined(QT_SHARED)) && !defined(QT_NO_LIBRARY)
- const QString driver = key.toLower();
- if (QObject *object = qLoadPlugin<QObject, QGenericPlugin>(loader(), driver, specification))
- return object;
-#else // (!Q_OS_WIN32 || QT_SHARED) && !QT_NO_LIBRARY
- Q_UNUSED(key)
- Q_UNUSED(specification)
-#endif
- return 0;
+ return qLoadPlugin<QObject, QGenericPlugin>(loader(), key.toLower(), specification);
}
/*!
@@ -95,8 +81,6 @@ QStringList QGenericPluginFactory::keys()
{
QStringList list;
-#if !defined(Q_OS_WIN32) || defined(QT_SHARED)
-#ifndef QT_NO_LIBRARY
typedef QMultiMap<int, QString> PluginKeyMap;
typedef PluginKeyMap::const_iterator PluginKeyMapConstIterator;
@@ -105,8 +89,6 @@ QStringList QGenericPluginFactory::keys()
for (PluginKeyMapConstIterator it = keyMap.constBegin(); it != cend; ++it)
if (!list.contains(it.value()))
list += it.value();
-#endif //QT_NO_LIBRARY
-#endif
return list;
}