summaryrefslogtreecommitdiffstats
path: root/src
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
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')
-rw-r--r--src/gui/accessible/qaccessible.cpp4
-rw-r--r--src/gui/accessible/qplatformaccessibility.cpp4
-rw-r--r--src/gui/image/qicon.cpp7
-rw-r--r--src/gui/image/qiconloader.cpp4
-rw-r--r--src/gui/image/qpicture.cpp2
-rw-r--r--src/gui/image/qpictureformatplugin.cpp4
-rw-r--r--src/gui/image/qpictureformatplugin.h4
-rw-r--r--src/gui/kernel/qgenericpluginfactory.cpp20
-rw-r--r--src/gui/kernel/qplatforminputcontextfactory.cpp6
-rw-r--r--src/gui/kernel/qplatformintegrationfactory.cpp7
-rw-r--r--src/gui/kernel/qplatformthemefactory.cpp17
-rw-r--r--src/network/bearer/qnetworkconfigmanager_p.cpp4
-rw-r--r--src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp21
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.cpp15
-rw-r--r--src/printsupport/kernel/qplatformprintplugin.cpp8
-rw-r--r--src/sql/kernel/qsqldatabase.cpp6
-rw-r--r--src/widgets/styles/qstylefactory.cpp6
17 files changed, 33 insertions, 106 deletions
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp
index 4758d1b5d4..757543281c 100644
--- a/src/gui/accessible/qaccessible.cpp
+++ b/src/gui/accessible/qaccessible.cpp
@@ -465,12 +465,10 @@ QAccessibleInterface::~QAccessibleInterface()
/* accessible widgets plugin discovery stuff */
-#ifndef QT_NO_LIBRARY
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QAccessibleFactoryInterface_iid, QLatin1String("/accessible")))
typedef QHash<QString, QAccessiblePlugin*> QAccessiblePluginsHash;
Q_GLOBAL_STATIC(QAccessiblePluginsHash, qAccessiblePlugins)
-#endif
// FIXME turn this into one global static struct
Q_GLOBAL_STATIC(QList<QAccessible::InterfaceFactory>, qAccessibleFactories)
@@ -691,7 +689,6 @@ QAccessibleInterface *QAccessible::queryAccessibleInterface(QObject *object)
return iface;
}
}
-#ifndef QT_NO_LIBRARY
// Find a QAccessiblePlugin (factory) for the class name. If there's
// no entry in the cache try to create it using the plugin loader.
if (!qAccessiblePlugins()->contains(cn)) {
@@ -713,7 +710,6 @@ QAccessibleInterface *QAccessible::queryAccessibleInterface(QObject *object)
}
return result;
}
-#endif
mo = mo->superClass();
}
diff --git a/src/gui/accessible/qplatformaccessibility.cpp b/src/gui/accessible/qplatformaccessibility.cpp
index df8fc8c49f..8c806d47b8 100644
--- a/src/gui/accessible/qplatformaccessibility.cpp
+++ b/src/gui/accessible/qplatformaccessibility.cpp
@@ -50,10 +50,8 @@ QT_BEGIN_NAMESPACE
#ifndef QT_NO_ACCESSIBILITY
/* accessiblebridge plugin discovery stuff */
-#ifndef QT_NO_LIBRARY
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, bridgeloader,
(QAccessibleBridgeFactoryInterface_iid, QLatin1String("/accessiblebridge")))
-#endif
Q_GLOBAL_STATIC(QVector<QAccessibleBridge *>, bridges)
@@ -112,7 +110,6 @@ void QPlatformAccessibility::initialize()
return;
isInit = true; // ### not atomic
-#ifndef QT_NO_LIBRARY
typedef QMultiMap<int, QString> PluginKeyMap;
typedef PluginKeyMap::const_iterator PluginKeyMapConstIterator;
@@ -129,7 +126,6 @@ void QPlatformAccessibility::initialize()
if (QAccessibleBridge *bridge = factory->create(it.value()))
bridges()->append(bridge);
}
-#endif
}
void QPlatformAccessibility::cleanup()
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp
index 0c716a89ff..62feaa92f9 100644
--- a/src/gui/image/qicon.cpp
+++ b/src/gui/image/qicon.cpp
@@ -529,7 +529,6 @@ void QPixmapIconEngine::virtual_hook(int id, void *data)
}
}
-#ifndef QT_NO_LIBRARY
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QIconEngineFactoryInterface_iid, QLatin1String("/iconengines"), Qt::CaseInsensitive))
@@ -537,8 +536,6 @@ QFactoryLoader *qt_iconEngineFactoryLoader()
{
return loader();
}
-#endif
-
/*!
@@ -1015,7 +1012,6 @@ void QIcon::addFile(const QString &fileName, const QSize &size, Mode mode, State
return;
detach();
if (!d) {
-#ifndef QT_NO_LIBRARY
QFileInfo info(fileName);
QString suffix = info.suffix();
if (!suffix.isEmpty()) {
@@ -1030,7 +1026,6 @@ void QIcon::addFile(const QString &fileName, const QSize &size, Mode mode, State
}
}
}
-#endif
// ...then fall back to the default engine
if (!d) {
d = new QIconPrivate;
@@ -1330,7 +1325,6 @@ QDataStream &operator>>(QDataStream &s, QIcon &icon)
QIconEngine *engine = new QIconLoaderEngine();
icon.d->engine = engine;
engine->read(s);
-#ifndef QT_NO_LIBRARY
} else {
const int index = loader()->indexOf(key);
if (index != -1) {
@@ -1342,7 +1336,6 @@ QDataStream &operator>>(QDataStream &s, QIcon &icon)
} // factory
} // instance
} // index
-#endif
}
} else if (s.version() == QDataStream::Qt_4_2) {
icon = QIcon();
diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp
index be032e498b..8cc1dfa7d0 100644
--- a/src/gui/image/qiconloader.cpp
+++ b/src/gui/image/qiconloader.cpp
@@ -94,9 +94,7 @@ static inline QStringList systemIconSearchPaths()
return QStringList();
}
-#ifndef QT_NO_LIBRARY
extern QFactoryLoader *qt_iconEngineFactoryLoader(); // qicon.cpp
-#endif
void QIconLoader::ensureInitialized()
{
@@ -109,10 +107,8 @@ void QIconLoader::ensureInitialized()
if (m_systemTheme.isEmpty())
m_systemTheme = fallbackTheme();
-#ifndef QT_NO_LIBRARY
if (qt_iconEngineFactoryLoader()->keyMap().key(QLatin1String("svg"), -1) != -1)
m_supportsSvg = true;
-#endif //QT_NO_LIBRARY
}
}
diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp
index 21bdfeff34..7506e2e1a9 100644
--- a/src/gui/image/qpicture.cpp
+++ b/src/gui/image/qpicture.cpp
@@ -1414,7 +1414,6 @@ Q_GLOBAL_STATIC(QPHList, pictureHandlers)
void qt_init_picture_plugins()
{
-#ifndef QT_NO_LIBRARY
typedef QMultiMap<int, QString> PluginKeyMap;
typedef PluginKeyMap::const_iterator PluginKeyMapConstIterator;
@@ -1429,7 +1428,6 @@ void qt_init_picture_plugins()
if (QPictureFormatPlugin *format = qobject_cast<QPictureFormatPlugin*>(loader.instance(it.key())))
format->installIOHandler(it.value());
}
-#endif
}
static void cleanup()
diff --git a/src/gui/image/qpictureformatplugin.cpp b/src/gui/image/qpictureformatplugin.cpp
index ece9a791f0..ef57ad720f 100644
--- a/src/gui/image/qpictureformatplugin.cpp
+++ b/src/gui/image/qpictureformatplugin.cpp
@@ -38,7 +38,7 @@
****************************************************************************/
#include "qpictureformatplugin.h"
-#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_PICTURE)
+#if !defined(QT_NO_PICTURE)
#include "qpicture.h"
QT_BEGIN_NAMESPACE
@@ -130,6 +130,6 @@ bool QPictureFormatPlugin::savePicture(const QString &format, const QString &fil
return false;
}
-#endif // QT_NO_LIBRARY || QT_NO_PICTURE
+#endif // QT_NO_PICTURE
QT_END_NAMESPACE
diff --git a/src/gui/image/qpictureformatplugin.h b/src/gui/image/qpictureformatplugin.h
index 5f8477b117..003ccac116 100644
--- a/src/gui/image/qpictureformatplugin.h
+++ b/src/gui/image/qpictureformatplugin.h
@@ -46,7 +46,7 @@
QT_BEGIN_NAMESPACE
-#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_PICTURE)
+#if !defined(QT_NO_PICTURE)
class QPicture;
class QImage;
@@ -68,7 +68,7 @@ public:
};
-#endif // QT_NO_LIBRARY || QT_NO_PICTURE
+#endif // QT_NO_PICTURE
QT_END_NAMESPACE
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;
}
diff --git a/src/gui/kernel/qplatforminputcontextfactory.cpp b/src/gui/kernel/qplatforminputcontextfactory.cpp
index dc2e2bde03..5f4f8d88fa 100644
--- a/src/gui/kernel/qplatforminputcontextfactory.cpp
+++ b/src/gui/kernel/qplatforminputcontextfactory.cpp
@@ -48,14 +48,14 @@
QT_BEGIN_NAMESPACE
-#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
+#ifndef QT_NO_SETTINGS
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QPlatformInputContextFactoryInterface_iid, QLatin1String("/platforminputcontexts"), Qt::CaseInsensitive))
#endif
QStringList QPlatformInputContextFactory::keys()
{
-#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
+#ifndef QT_NO_SETTINGS
return loader()->keyMap().values();
#else
return QStringList();
@@ -70,7 +70,7 @@ QString QPlatformInputContextFactory::requested()
QPlatformInputContext *QPlatformInputContextFactory::create(const QString& key)
{
-#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
+#ifndef QT_NO_SETTINGS
if (!key.isEmpty()) {
QStringList paramList = key.split(QLatin1Char(':'));
const QString platform = paramList.takeFirst().toLower();
diff --git a/src/gui/kernel/qplatformintegrationfactory.cpp b/src/gui/kernel/qplatformintegrationfactory.cpp
index 7207ea6789..566d025b28 100644
--- a/src/gui/kernel/qplatformintegrationfactory.cpp
+++ b/src/gui/kernel/qplatformintegrationfactory.cpp
@@ -80,8 +80,8 @@ QPlatformIntegration *QPlatformIntegrationFactory::create(const QString &platfor
QStringList QPlatformIntegrationFactory::keys(const QString &platformPluginPath)
{
-#ifndef QT_NO_LIBRARY
QStringList list;
+#ifndef QT_NO_LIBRARY
if (!platformPluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(platformPluginPath);
list = directLoader()->keyMap().values();
@@ -94,12 +94,11 @@ QStringList QPlatformIntegrationFactory::keys(const QString &platformPluginPath)
(*it).append(postFix);
}
}
- list.append(loader()->keyMap().values());
- return list;
#else
Q_UNUSED(platformPluginPath);
- return QStringList();
#endif
+ list.append(loader()->keyMap().values());
+ return list;
}
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qplatformthemefactory.cpp b/src/gui/kernel/qplatformthemefactory.cpp
index dd000c1571..40ba844e57 100644
--- a/src/gui/kernel/qplatformthemefactory.cpp
+++ b/src/gui/kernel/qplatformthemefactory.cpp
@@ -48,31 +48,29 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_LIBRARY
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QPlatformThemeFactoryInterface_iid, QLatin1String("/platformthemes"), Qt::CaseInsensitive))
+
+#ifndef QT_NO_LIBRARY
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
(QPlatformThemeFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive))
#endif
QPlatformTheme *QPlatformThemeFactory::create(const QString& key, const QString &platformPluginPath)
{
-#ifndef QT_NO_LIBRARY
QStringList paramList = key.split(QLatin1Char(':'));
const QString platform = paramList.takeFirst().toLower();
-
+#ifndef QT_NO_LIBRARY
// Try loading the plugin from platformPluginPath first:
if (!platformPluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(platformPluginPath);
if (QPlatformTheme *ret = qLoadPlugin<QPlatformTheme, QPlatformThemePlugin>(directLoader(), platform, paramList))
return ret;
}
- return qLoadPlugin<QPlatformTheme, QPlatformThemePlugin>(loader(), platform, paramList);
#else
- Q_UNUSED(key);
Q_UNUSED(platformPluginPath);
- return 0;
#endif
+ return qLoadPlugin<QPlatformTheme, QPlatformThemePlugin>(loader(), platform, paramList);
}
/*!
@@ -83,9 +81,9 @@ QPlatformTheme *QPlatformThemeFactory::create(const QString& key, const QString
*/
QStringList QPlatformThemeFactory::keys(const QString &platformPluginPath)
{
-#ifndef QT_NO_LIBRARY
QStringList list;
+#ifndef QT_NO_LIBRARY
if (!platformPluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(platformPluginPath);
list += directLoader()->keyMap().values();
@@ -98,12 +96,11 @@ QStringList QPlatformThemeFactory::keys(const QString &platformPluginPath)
(*it).append(postFix);
}
}
- list += loader()->keyMap().values();
- return list;
#else
Q_UNUSED(platformPluginPath);
- return QStringList();
#endif
+ list += loader()->keyMap().values();
+ return list;
}
QT_END_NAMESPACE
diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp
index 336233c5d8..3101a98165 100644
--- a/src/network/bearer/qnetworkconfigmanager_p.cpp
+++ b/src/network/bearer/qnetworkconfigmanager_p.cpp
@@ -367,10 +367,8 @@ void QNetworkConfigurationManagerPrivate::configurationChanged(QNetworkConfigura
void QNetworkConfigurationManagerPrivate::updateConfigurations()
{
-#ifndef QT_NO_LIBRARY
typedef QMultiMap<int, QString> PluginKeyMap;
typedef PluginKeyMap::const_iterator PluginKeyMapConstIterator;
-#endif
QMutexLocker locker(&mutex);
if (firstUpdate) {
@@ -379,7 +377,6 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
updating = false;
-#ifndef QT_NO_LIBRARY
bool envOK = false;
const int skipGeneric = qEnvironmentVariableIntValue("QT_EXCLUDE_GENERIC_BEARER", &envOK);
QBearerEngine *generic = 0;
@@ -421,7 +418,6 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
if (!envOK || skipGeneric <= 0)
sessionEngines.append(generic);
}
-#endif // QT_NO_LIBRARY
}
QBearerEngine *engine = qobject_cast<QBearerEngine *>(sender());
diff --git a/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp b/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp
index 79ece86570..84351dba5a 100644
--- a/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp
+++ b/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp
@@ -63,20 +63,18 @@ QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(qLcEglDevDebug, "qt.qpa.egldeviceintegration")
-#ifndef QT_NO_LIBRARY
-
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QEGLDeviceIntegrationFactoryInterface_iid, QLatin1String("/egldeviceintegrations"), Qt::CaseInsensitive))
+#ifndef QT_NO_LIBRARY
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
(QEGLDeviceIntegrationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive))
-
#endif // QT_NO_LIBRARY
QStringList QEGLDeviceIntegrationFactory::keys(const QString &pluginPath)
{
-#ifndef QT_NO_LIBRARY
QStringList list;
+#ifndef QT_NO_LIBRARY
if (!pluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(pluginPath);
list = directLoader()->keyMap().values();
@@ -89,13 +87,12 @@ QStringList QEGLDeviceIntegrationFactory::keys(const QString &pluginPath)
(*it).append(postFix);
}
}
- list.append(loader()->keyMap().values());
- qCDebug(qLcEglDevDebug) << "EGL device integration plugin keys:" << list;
- return list;
#else
Q_UNUSED(pluginPath);
- return QStringList();
#endif
+ list.append(loader()->keyMap().values());
+ qCDebug(qLcEglDevDebug) << "EGL device integration plugin keys:" << list;
+ return list;
}
QEGLDeviceIntegration *QEGLDeviceIntegrationFactory::create(const QString &key, const QString &pluginPath)
@@ -106,16 +103,16 @@ QEGLDeviceIntegration *QEGLDeviceIntegrationFactory::create(const QString &key,
QCoreApplication::addLibraryPath(pluginPath);
integration = qLoadPlugin<QEGLDeviceIntegration, QEGLDeviceIntegrationPlugin>(directLoader(), key);
}
+#else
+ Q_UNUSED(pluginPath);
+#endif
if (!integration)
integration = qLoadPlugin<QEGLDeviceIntegration, QEGLDeviceIntegrationPlugin>(loader(), key);
if (integration)
qCDebug(qLcEglDevDebug) << "Using EGL device integration" << key;
else
qCWarning(qLcEglDevDebug) << "Failed to load EGL device integration" << key;
-#else
- Q_UNUSED(key);
- Q_UNUSED(pluginPath);
-#endif
+
return integration;
}
diff --git a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.cpp b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.cpp
index f0bd930ca6..8e1688dbe8 100644
--- a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.cpp
+++ b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.cpp
@@ -47,17 +47,18 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_LIBRARY
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QXcbGlIntegrationFactoryInterface_iid, QLatin1String("/xcbglintegrations"), Qt::CaseInsensitive))
+
+#ifndef QT_NO_LIBRARY
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
(QXcbGlIntegrationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive))
#endif // !QT_NO_LIBRARY
QStringList QXcbGlIntegrationFactory::keys(const QString &pluginPath)
{
-#ifndef QT_NO_LIBRARY
QStringList list;
+#ifndef QT_NO_LIBRARY
if (!pluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(pluginPath);
list = directLoader()->keyMap().values();
@@ -70,12 +71,11 @@ QStringList QXcbGlIntegrationFactory::keys(const QString &pluginPath)
(*it).append(postFix);
}
}
- list.append(loader()->keyMap().values());
- return list;
#else
Q_UNUSED(pluginPath);
- return QStringList();
#endif
+ list.append(loader()->keyMap().values());
+ return list;
}
QXcbGlIntegration *QXcbGlIntegrationFactory::create(const QString &platform, const QString &pluginPath)
@@ -87,13 +87,10 @@ QXcbGlIntegration *QXcbGlIntegrationFactory::create(const QString &platform, con
if (QXcbGlIntegration *ret = qLoadPlugin<QXcbGlIntegration, QXcbGlIntegrationPlugin>(directLoader(), platform))
return ret;
}
- if (QXcbGlIntegration *ret = qLoadPlugin<QXcbGlIntegration, QXcbGlIntegrationPlugin>(loader(), platform))
- return ret;
#else
- Q_UNUSED(platform);
Q_UNUSED(pluginPath);
#endif
- return Q_NULLPTR;
+ return qLoadPlugin<QXcbGlIntegration, QXcbGlIntegrationPlugin>(loader(), platform);
}
QT_END_NAMESPACE
diff --git a/src/printsupport/kernel/qplatformprintplugin.cpp b/src/printsupport/kernel/qplatformprintplugin.cpp
index dc059f6612..b50f43056b 100644
--- a/src/printsupport/kernel/qplatformprintplugin.cpp
+++ b/src/printsupport/kernel/qplatformprintplugin.cpp
@@ -45,10 +45,8 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_LIBRARY
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QPlatformPrinterSupportFactoryInterface_iid, QLatin1String("/printsupport"), Qt::CaseInsensitive))
-#endif
QPlatformPrinterSupportPlugin::QPlatformPrinterSupportPlugin(QObject *parent)
: QObject(parent)
@@ -61,15 +59,11 @@ QPlatformPrinterSupportPlugin::~QPlatformPrinterSupportPlugin()
static QPlatformPrinterSupport *printerSupport = 0;
-#ifndef QT_NO_LIBRARY
static void cleanupPrinterSupport()
{
-#ifndef QT_NO_PRINTER
delete printerSupport;
-#endif
printerSupport = 0;
}
-#endif // !QT_NO_LIBRARY
/*!
\internal
@@ -81,7 +75,6 @@ static void cleanupPrinterSupport()
*/
QPlatformPrinterSupport *QPlatformPrinterSupportPlugin::get()
{
-#ifndef QT_NO_LIBRARY
if (!printerSupport) {
const QMultiMap<int, QString> keyMap = loader()->keyMap();
if (!keyMap.isEmpty())
@@ -89,7 +82,6 @@ QPlatformPrinterSupport *QPlatformPrinterSupportPlugin::get()
if (printerSupport)
qAddPostRoutine(cleanupPrinterSupport);
}
-#endif // !QT_NO_LIBRARY
return printerSupport;
}
diff --git a/src/sql/kernel/qsqldatabase.cpp b/src/sql/kernel/qsqldatabase.cpp
index 8841106c0f..62e1b6a7a5 100644
--- a/src/sql/kernel/qsqldatabase.cpp
+++ b/src/sql/kernel/qsqldatabase.cpp
@@ -99,11 +99,9 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_LIBRARY
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QSqlDriverFactoryInterface_iid,
QLatin1String("/sqldrivers")))
-#endif
#if !defined(Q_CC_MSVC) || _MSC_VER >= 1900
// ### Qt6: remove the #ifdef
@@ -577,7 +575,6 @@ QStringList QSqlDatabase::drivers()
list << QLatin1String("QIBASE");
#endif
-#ifndef QT_NO_LIBRARY
if (QFactoryLoader *fl = loader()) {
typedef QMultiMap<int, QString> PluginKeyMap;
typedef PluginKeyMap::const_iterator PluginKeyMapConstIterator;
@@ -588,7 +585,6 @@ QStringList QSqlDatabase::drivers()
if (!list.contains(it.value()))
list << it.value();
}
-#endif
DriverDict dict = QSqlDatabasePrivate::driverDict();
for (DriverDict::const_iterator i = dict.constBegin(); i != dict.constEnd(); ++i) {
@@ -778,10 +774,8 @@ void QSqlDatabasePrivate::init(const QString &type)
}
}
-#ifndef QT_NO_LIBRARY
if (!driver && loader())
driver = qLoadPlugin<QSqlDriver, QSqlDriverPlugin>(loader(), type);
-#endif // QT_NO_LIBRARY
if (!driver) {
qWarning("QSqlDatabase: %s driver not loaded", type.toLatin1().data());
diff --git a/src/widgets/styles/qstylefactory.cpp b/src/widgets/styles/qstylefactory.cpp
index b045933a6d..bebd322c9e 100644
--- a/src/widgets/styles/qstylefactory.cpp
+++ b/src/widgets/styles/qstylefactory.cpp
@@ -69,10 +69,8 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_LIBRARY
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QStyleFactoryInterface_iid, QLatin1String("/styles"), Qt::CaseInsensitive))
-#endif
/*!
\class QStyleFactory
@@ -156,10 +154,8 @@ QStyle *QStyleFactory::create(const QString& key)
} else
#endif
{ } // Keep these here - they make the #ifdefery above work
-#ifndef QT_NO_LIBRARY
if (!ret)
ret = qLoadPlugin<QStyle, QStylePlugin>(loader(), style);
-#endif
if(ret)
ret->setObjectName(style);
return ret;
@@ -174,14 +170,12 @@ QStyle *QStyleFactory::create(const QString& key)
QStringList QStyleFactory::keys()
{
QStringList list;
-#ifndef QT_NO_LIBRARY
typedef QMultiMap<int, QString> PluginKeyMap;
const PluginKeyMap keyMap = loader()->keyMap();
const PluginKeyMap::const_iterator cend = keyMap.constEnd();
for (PluginKeyMap::const_iterator it = keyMap.constBegin(); it != cend; ++it)
list.append(it.value());
-#endif
#ifndef QT_NO_STYLE_WINDOWS
if (!list.contains(QLatin1String("Windows")))
list << QLatin1String("Windows");