Replace #ifdefs with qmake feature checks.

This prevents the building of dysfunctional plugins that don't define
a loader function, or won't compile at all.

Change-Id: Ib62edb8db4a8917effa05292cb702bb4022f552c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This commit is contained in:
Ulf Hermann 2015-06-19 13:27:53 +02:00
parent b93d1f6b1f
commit 68e31e4ab9
34 changed files with 14 additions and 110 deletions

View File

@ -36,7 +36,6 @@
#include <QtCore/qdebug.h>
#ifndef QT_NO_BEARERMANAGEMENT
#ifndef QT_NO_DBUS
QT_BEGIN_NAMESPACE
@ -78,4 +77,3 @@ QT_END_NAMESPACE
#include "main.moc"
#endif
#endif // QT_NO_BEARERMANAGEMENT

View File

@ -46,7 +46,6 @@
#include <QtDBus/QDBusInterface>
#include <QtDBus/QDBusMessage>
#include <QtDBus/QDBusReply>
#ifndef QT_NO_BEARERMANAGEMENT
#ifndef QT_NO_DBUS
QT_BEGIN_NAMESPACE
@ -556,4 +555,3 @@ void QConnmanEngine::reEvaluateCellular()
QT_END_NAMESPACE
#endif // QT_NO_DBUS
#endif // QT_NO_BEARERMANAGEMENT

View File

@ -53,7 +53,6 @@
#include <QMap>
#include <QVariant>
#ifndef QT_NO_BEARERMANAGEMENT
#ifndef QT_NO_DBUS
QT_BEGIN_NAMESPACE
@ -135,7 +134,6 @@ protected:
QT_END_NAMESPACE
#endif // QT_NO_DBUS
#endif // QT_NO_BEARERMANAGEMENT
#endif

View File

@ -45,7 +45,6 @@
#include "qconnmanservice_linux_p.h"
#ifndef QT_NO_BEARERMANAGEMENT
#ifndef QT_NO_DBUS
QT_BEGIN_NAMESPACE
@ -504,5 +503,3 @@ void QConnmanTechnologyInterface::scanReply(QDBusPendingCallWatcher *call)
QT_END_NAMESPACE
#endif // QT_NO_DBUS
#endif // QT_NO_BEARERMANAGEMENT

View File

@ -58,7 +58,6 @@
#include <QtDBus/QDBusContext>
#include <QMap>
#ifndef QT_NO_BEARERMANAGEMENT
#ifndef QT_NO_DBUS
#ifndef __CONNMAN_DBUS_H
@ -219,6 +218,5 @@ private:
QT_END_NAMESPACE
#endif // QT_NO_DBUS
#endif // QT_NO_BEARERMANAGEMENT
#endif //QCONNMANSERVICE_H

View File

@ -37,8 +37,6 @@
#include <QtCore/qdebug.h>
#ifndef QT_NO_BEARERMANAGEMENT
QT_BEGIN_NAMESPACE
class QGenericEnginePlugin : public QBearerEnginePlugin
@ -72,5 +70,3 @@ QBearerEngine *QGenericEnginePlugin::create(const QString &key) const
QT_END_NAMESPACE
#include "main.moc"
#endif // QT_NO_BEARERMANAGEMENT

View File

@ -61,8 +61,6 @@ typedef ULONG NDIS_OID, *PNDIS_OID;
#include <unistd.h>
#endif
#ifndef QT_NO_BEARERMANAGEMENT
QT_BEGIN_NAMESPACE
#ifndef QT_NO_NETWORKINTERFACE
@ -385,5 +383,3 @@ bool QGenericEngine::requiresPolling() const
}
QT_END_NAMESPACE
#endif // QT_NO_BEARERMANAGEMENT

View File

@ -39,8 +39,6 @@
#include <QMap>
#include <QTimer>
#ifndef QT_NO_BEARERMANAGEMENT
QT_BEGIN_NAMESPACE
class QNetworkConfigurationPrivate;
@ -82,7 +80,5 @@ private:
QT_END_NAMESPACE
#endif // QT_NO_BEARERMANAGEMENT
#endif

View File

@ -45,7 +45,6 @@
#include "qofonoservice_linux_p.h"
#ifndef QT_NO_BEARERMANAGEMENT
#ifndef QT_NO_DBUS
QDBusArgument &operator<<(QDBusArgument &argument, const ObjectPathProperties &item)
@ -382,4 +381,3 @@ QString QOfonoConnectionContextInterface::name()
QT_END_NAMESPACE
#endif // QT_NO_DBUS
#endif // QT_NO_BEARERMANAGEMENT

View File

@ -57,7 +57,6 @@
#include <QtDBus/QDBusContext>
#include <QMap>
#ifndef QT_NO_BEARERMANAGEMENT
#ifndef QT_NO_DBUS
#define OFONO_SERVICE "org.ofono"
@ -193,6 +192,5 @@ private slots:
QT_END_NAMESPACE
#endif // QT_NO_DBUS
#endif // QT_NO_BEARERMANAGEMENT
#endif //QOFONOSERVICE_H

View File

@ -37,7 +37,6 @@
#include <QtCore/qdebug.h>
#ifndef QT_NO_BEARERMANAGEMENT
#ifndef QT_NO_DBUS
QT_BEGIN_NAMESPACE
@ -77,4 +76,3 @@ QT_END_NAMESPACE
#include "main.moc"
#endif // QT_NO_DBUS
#endif // QT_NO_BEARERMANAGEMENT

View File

@ -49,7 +49,6 @@
#include <QDBusReply>
#include "../linux_common/qofonoservice_linux_p.h"
#ifndef QT_NO_BEARERMANAGEMENT
#ifndef QT_NO_DBUS
QT_BEGIN_NAMESPACE
@ -1129,4 +1128,3 @@ void QNetworkManagerEngine::ofonoUnRegistered(const QString &)
QT_END_NAMESPACE
#endif // QT_NO_DBUS
#endif // QT_NO_BEARERMANAGEMENT

View File

@ -54,7 +54,6 @@
#include <QMap>
#include <QVariant>
#ifndef QT_NO_BEARERMANAGEMENT
#ifndef QT_NO_DBUS
QT_BEGIN_NAMESPACE
@ -150,7 +149,6 @@ private:
QT_END_NAMESPACE
#endif // QT_NO_DBUS
#endif // QT_NO_BEARERMANAGEMENT
#endif

View File

@ -36,8 +36,6 @@
#include <QtNetwork/private/qbearerengine_p.h>
#ifndef QT_NO_BEARERMANAGEMENT
QT_BEGIN_NAMESPACE
class QBearerEngineImpl : public QBearerEngine
@ -74,6 +72,4 @@ QT_END_NAMESPACE
Q_DECLARE_METATYPE(QBearerEngineImpl::ConnectionError)
#endif // QT_NO_BEARERMANAGEMENT
#endif // QBEARERENGINE_IMPL_H

View File

@ -42,8 +42,6 @@
#include <QtCore/qmutex.h>
#include <QtCore/qstringlist.h>
#ifndef QT_NO_BEARERMANAGEMENT
QT_BEGIN_NAMESPACE
static QBearerEngineImpl *getEngineFromId(const QString &id)
@ -423,5 +421,3 @@ void QNetworkSessionPrivateImpl::decrementTimeout()
}
QT_END_NAMESPACE
#endif // QT_NO_BEARERMANAGEMENT

View File

@ -50,8 +50,6 @@
#include <QtNetwork/private/qnetworkconfigmanager_p.h>
#include <QtNetwork/private/qnetworksession_p.h>
#ifndef QT_NO_BEARERMANAGEMENT
QT_BEGIN_NAMESPACE
class QBearerEngineImpl;
@ -123,6 +121,4 @@ private:
QT_END_NAMESPACE
#endif // QT_NO_BEARERMANAGEMENT
#endif // QNETWORKSESSION_IMPL_H

View File

@ -34,8 +34,6 @@
#include <qimageiohandler.h>
#include <qstringlist.h>
#ifndef QT_NO_IMAGEFORMATPLUGIN
#include "main.h"
#ifdef QT_NO_IMAGEFORMAT_GIF
@ -69,6 +67,4 @@ QImageIOHandler *QGifPlugin::create(QIODevice *device, const QByteArray &format)
return handler;
}
#endif // QT_NO_IMAGEFORMATPLUGIN
QT_END_NAMESPACE

View File

@ -34,8 +34,6 @@
#include <qimageiohandler.h>
#include <qstringlist.h>
#ifndef QT_NO_IMAGEFORMATPLUGIN
#ifdef QT_NO_IMAGEFORMAT_GIF
#undef QT_NO_IMAGEFORMAT_GIF
#endif
@ -56,5 +54,3 @@ public:
};
QT_END_NAMESPACE
#endif // QT_NO_IMAGEFORMATPLUGIN

View File

@ -33,8 +33,6 @@
#include "main.h"
#ifndef QT_NO_IMAGEFORMATPLUGIN
QT_BEGIN_NAMESPACE
QImageIOPlugin::Capabilities QICOPlugin::capabilities(QIODevice *device, const QByteArray &format) const
@ -63,5 +61,3 @@ QImageIOHandler *QICOPlugin::create(QIODevice *device, const QByteArray &format)
}
QT_END_NAMESPACE
#endif /* QT_NO_IMAGEFORMATPLUGIN */

View File

@ -34,8 +34,6 @@
#include <qimageiohandler.h>
#include <qdebug.h>
#ifndef QT_NO_IMAGEFORMATPLUGIN
#ifdef QT_NO_IMAGEFORMAT_ICO
#undef QT_NO_IMAGEFORMAT_ICO
#endif
@ -53,5 +51,3 @@ public:
};
QT_END_NAMESPACE
#endif

View File

@ -33,8 +33,6 @@
#include "main.h"
#ifndef QT_NO_IMAGEFORMATPLUGIN
#ifdef QT_NO_IMAGEFORMAT_JPEG
#undef QT_NO_IMAGEFORMAT_JPEG
#endif
@ -68,5 +66,3 @@ QImageIOHandler *QJpegPlugin::create(QIODevice *device, const QByteArray &format
}
QT_END_NAMESPACE
#endif // QT_NO_IMAGEFORMATPLUGIN

View File

@ -34,8 +34,6 @@
#include <qimageiohandler.h>
#include <qstringlist.h>
#ifndef QT_NO_IMAGEFORMATPLUGIN
#ifdef QT_NO_IMAGEFORMAT_JPEG
#undef QT_NO_IMAGEFORMAT_JPEG
#endif
@ -52,5 +50,3 @@ public:
};
QT_END_NAMESPACE
#endif

View File

@ -1,8 +1,15 @@
TEMPLATE = subdirs
load(qfeatures)
SUBDIRS *= sqldrivers
!winrt:qtHaveModule(network): SUBDIRS += bearer
qtHaveModule(gui): SUBDIRS *= imageformats platforms platforminputcontexts platformthemes generic
!winrt:qtHaveModule(network):!contains(QT_DISABLED_FEATURES, bearermanagement): SUBDIRS += bearer
qtHaveModule(gui) {
SUBDIRS *= platforms platforminputcontexts platformthemes
!contains(QT_DISABLED_FEATURES, imageformatplugin): SUBDIRS *= imageformats
!contains(QT_DISABLED_FEATURES, library): SUBDIRS *= generic
}
qtHaveModule(widgets): SUBDIRS *= styles
!winrt:!wince*:qtHaveModule(widgets):SUBDIRS += printsupport
!winrt:!wince*:qtHaveModule(widgets):!contains(QT_DISABLED_FEATURES, printer) {
SUBDIRS += printsupport
}

View File

@ -38,8 +38,6 @@
QT_BEGIN_NAMESPACE
#ifndef QT_NO_PRINTER
class QCocoaPrinterSupportPlugin : public QPlatformPrinterSupportPlugin
{
Q_OBJECT
@ -67,8 +65,6 @@ QPlatformPrinterSupport *QCocoaPrinterSupportPlugin::create(const QString &key)
return platformPrinterSupport;
}
#endif
QT_END_NAMESPACE
#include "main.moc"

View File

@ -37,8 +37,6 @@
#include <qpa/qplatformprintplugin.h>
#include <QtCore/QStringList>
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_CUPS)
QT_BEGIN_NAMESPACE
class QCupsPrinterSupportPlugin : public QPlatformPrinterSupportPlugin
@ -65,6 +63,4 @@ QPlatformPrinterSupport *QCupsPrinterSupportPlugin::create(const QString &key)
QT_END_NAMESPACE
#endif // !defined(QT_NO_PRINTER) && !defined(QT_NO_CUPS)
#include "main.moc"

View File

@ -33,8 +33,6 @@
#include "qcupsprintengine_p.h"
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_CUPS)
#include <qpa/qplatformprintplugin.h>
#include <qpa/qplatformprintersupport.h>
@ -315,5 +313,3 @@ void QCupsPrintEnginePrivate::setPageSize(const QPageSize &pageSize)
}
QT_END_NAMESPACE
#endif // !defined(QT_NO_PRINTER) && !defined(QT_NO_CUPS)

View File

@ -47,8 +47,6 @@
#include "QtPrintSupport/qprintengine.h"
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_CUPS)
#include <QtCore/qstring.h>
#include <QtGui/qpaintengine.h>
@ -100,6 +98,4 @@ private:
QT_END_NAMESPACE
#endif // !defined(QT_NO_PRINTER) && !defined(QT_NO_CUPS)
#endif // QCUPSPRINTENGINE_P_H

View File

@ -34,8 +34,6 @@
#include "qcupsprintersupport_p.h"
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_CUPS)
#include "qcupsprintengine_p.h"
#include "qppdprintdevice.h"
#include <private/qprinterinfo_p.h>
@ -109,5 +107,3 @@ QString QCupsPrinterSupport::defaultPrintDeviceId() const
}
QT_END_NAMESPACE
#endif // !defined(QT_NO_PRINTER) && !defined(QT_NO_CUPS)

View File

@ -48,8 +48,6 @@
#include <qpa/qplatformprintersupport.h>
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_CUPS)
#include <QtCore/qstringlist.h>
QT_BEGIN_NAMESPACE
@ -73,5 +71,4 @@ private:
QT_END_NAMESPACE
#endif // !defined(QT_NO_PRINTER) && !defined(QT_NO_CUPS)
#endif // QCUPSPRINTERSUPPORT_H

View File

@ -42,8 +42,6 @@
QT_BEGIN_NAMESPACE
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_CUPS)
QPpdPrintDevice::QPpdPrintDevice()
: QPlatformPrintDevice(),
m_cupsDest(0),
@ -472,6 +470,4 @@ cups_ptype_e QPpdPrintDevice::printerTypeFlags() const
return static_cast<cups_ptype_e>(printerOption("printer-type").toUInt());
}
#endif // !defined(QT_NO_PRINTER) && !defined(QT_NO_CUPS)
QT_END_NAMESPACE

View File

@ -47,8 +47,6 @@
#include <qpa/qplatformprintdevice.h>
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_CUPS)
#include <QtCore/qbytearray.h>
#include <QtCore/qhash.h>
#include <QtCore/qmargins.h>
@ -111,5 +109,4 @@ private:
QT_END_NAMESPACE
#endif // !defined(QT_NO_PRINTER) && !defined(QT_NO_CUPS)
#endif // QPPDPRINTDEVICE_H

View File

@ -2,4 +2,7 @@ TEMPLATE = subdirs
osx: SUBDIRS += cocoa
win32: SUBDIRS += windows
unix:!mac:contains(QT_CONFIG, cups): SUBDIRS += cups
unix:!mac:contains(QT_CONFIG, cups) {
load(qfeatures)
!contains(QT_DISABLED_FEATURES, cups): SUBDIRS += cups
}

View File

@ -41,8 +41,6 @@
QT_BEGIN_NAMESPACE
#ifndef QT_NO_PRINTER
QT_WARNING_DISABLE_GCC("-Wsign-compare")
extern qreal qt_pointMultiplier(QPageLayout::Unit unit);
@ -471,6 +469,4 @@ QString QWindowsPrintDevice::defaultPrintDeviceId()
return QString::fromWCharArray(name.data());
}
#endif // QT_NO_PRINTER
QT_END_NAMESPACE

View File

@ -47,8 +47,6 @@
#include <qpa/qplatformprintdevice.h>
#ifndef QT_NO_PRINTER
#include <QtCore/qt_windows.h>
QT_BEGIN_NAMESPACE
@ -95,5 +93,4 @@ private:
QT_END_NAMESPACE
#endif // QT_NO_PRINTER
#endif // QWINDOWSPRINTDEVICE_H