Use new feature system, part 2

Convert all uses of QT_NO_FOO to proper QT_CONFIG(foo) checks.

Change-Id: Id0f0b3325c246567a43d6b2d71b0d69e5535e648
Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
Lars Knoll 2016-11-16 11:10:14 +01:00
parent 1d51cabc54
commit f6912982eb
28 changed files with 67 additions and 66 deletions

View File

@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
namespace QtWaylandClient {
#ifndef QT_NO_LIBRARY
#if QT_CONFIG(library)
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QWaylandClientBufferIntegrationFactoryInterface_iid, QLatin1String("/wayland-graphics-integration-client"), Qt::CaseInsensitive))
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
@ -57,7 +57,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
QStringList QWaylandClientBufferIntegrationFactory::keys(const QString &pluginPath)
{
#ifndef QT_NO_LIBRARY
#if QT_CONFIG(library)
QStringList list;
if (!pluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(pluginPath);
@ -80,7 +80,7 @@ QStringList QWaylandClientBufferIntegrationFactory::keys(const QString &pluginPa
QWaylandClientBufferIntegration *QWaylandClientBufferIntegrationFactory::create(const QString &name, const QStringList &args, const QString &pluginPath)
{
#ifndef QT_NO_LIBRARY
#if QT_CONFIG(library)
// Try loading the plugin from platformPluginPath first:
if (!pluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(pluginPath);

View File

@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
namespace QtWaylandClient {
#ifndef QT_NO_LIBRARY
#if QT_CONFIG(library)
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QWaylandServerBufferIntegrationFactoryInterface_iid, QLatin1String("/wayland-graphics-integration-client"), Qt::CaseInsensitive))
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
@ -57,7 +57,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
QStringList QWaylandServerBufferIntegrationFactory::keys(const QString &pluginPath)
{
#ifndef QT_NO_LIBRARY
#if QT_CONFIG(library)
QStringList list;
if (!pluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(pluginPath);
@ -80,7 +80,7 @@ QStringList QWaylandServerBufferIntegrationFactory::keys(const QString &pluginPa
QWaylandServerBufferIntegration *QWaylandServerBufferIntegrationFactory::create(const QString &name, const QStringList &args, const QString &pluginPath)
{
#ifndef QT_NO_LIBRARY
#if QT_CONFIG(library)
// Try loading the plugin from platformPluginPath first:
if (!pluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(pluginPath);

View File

@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
namespace QtWaylandClient {
#ifndef QT_NO_LIBRARY
#if QT_CONFIG(library)
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QWaylandInputDeviceIntegrationFactoryInterface_iid, QLatin1String("/wayland-inputdevice-integration"), Qt::CaseInsensitive))
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
@ -57,7 +57,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
QStringList QWaylandInputDeviceIntegrationFactory::keys(const QString &pluginPath)
{
#ifndef QT_NO_LIBRARY
#if QT_CONFIG(library)
QStringList list;
if (!pluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(pluginPath);
@ -80,7 +80,7 @@ QStringList QWaylandInputDeviceIntegrationFactory::keys(const QString &pluginPat
QWaylandInputDeviceIntegration *QWaylandInputDeviceIntegrationFactory::create(const QString &name, const QStringList &args, const QString &pluginPath)
{
#ifndef QT_NO_LIBRARY
#if QT_CONFIG(library)
// Try loading the plugin from platformPluginPath first:
if (!pluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(pluginPath);

View File

@ -56,7 +56,7 @@ namespace QtWaylandClient {
#define BUTTON_SPACING 5
#ifndef QT_NO_IMAGEFORMAT_XPM
#if QT_CONFIG(imageformat_xpm)
# define BUTTON_WIDTH 10
static const char * const qt_close_xpm[] = {
@ -265,7 +265,7 @@ void QWaylandBradientDecoration::paint(QPaintDevice *device)
p.restore();
}
#ifndef QT_NO_IMAGEFORMAT_XPM
#if QT_CONFIG(imageformat_xpm)
p.save();
// Close button

View File

@ -44,7 +44,7 @@
#include "qwaylanddatasource_p.h"
#include "qwaylanddatadevice_p.h"
#ifndef QT_NO_DRAGANDDROP
#if QT_CONFIG(draganddrop)
QT_BEGIN_NAMESPACE
@ -118,4 +118,4 @@ bool QWaylandClipboard::ownsMode(QClipboard::Mode mode) const
QT_END_NAMESPACE
#endif // QT_NO_DRAGANDDROP
#endif // draganddrop

View File

@ -57,7 +57,7 @@
#include <QtWaylandClient/qtwaylandclientglobal.h>
#ifndef QT_NO_DRAGANDDROP
#if QT_CONFIG(draganddrop)
QT_BEGIN_NAMESPACE
namespace QtWaylandClient {
@ -85,6 +85,6 @@ private:
QT_END_NAMESPACE
#endif // QT_NO_DRAGANDDROP
#endif // draganddrop
#endif // QWAYLANDCLIPBOARD_H

View File

@ -56,7 +56,7 @@
#include <qpa/qplatformdrag.h>
#include <qpa/qwindowsysteminterface.h>
#ifndef QT_NO_DRAGANDDROP
#if QT_CONFIG(draganddrop)
QT_BEGIN_NAMESPACE
@ -271,4 +271,4 @@ QPoint QWaylandDataDevice::calculateDragPosition(int x, int y, QWindow *wnd) con
QT_END_NAMESPACE
#endif // QT_NO_DRAGANDDROP
#endif // draganddrop

View File

@ -52,13 +52,14 @@
// We mean it.
//
#include <qtwaylandclientglobal.h>
#include <QObject>
#include <QPointer>
#include <QPoint>
#include <QtWaylandClient/private/qwayland-wayland.h>
#ifndef QT_NO_DRAGANDDROP
#if QT_CONFIG(draganddrop)
QT_BEGIN_NAMESPACE
@ -122,6 +123,6 @@ private:
QT_END_NAMESPACE
#endif // QT_NO_DRAGANDDROP
#endif // draganddrop
#endif // QWAYLANDDATADEVICE_H

View File

@ -46,7 +46,7 @@
#include <QtCore/QDebug>
#ifndef QT_NO_DRAGANDDROP
#if QT_CONFIG(draganddrop)
QT_BEGIN_NAMESPACE
@ -83,4 +83,4 @@ QWaylandDisplay *QWaylandDataDeviceManager::display() const
QT_END_NAMESPACE
#endif // QT_NO_DRAGANDDROP
#endif // draganddrop

View File

@ -54,7 +54,7 @@
#include <QtWaylandClient/qtwaylandclientglobal.h>
#include <QtWaylandClient/private/qwayland-wayland.h>
#ifndef QT_NO_DRAGANDDROP
#if QT_CONFIG(draganddrop)
QT_BEGIN_NAMESPACE
@ -83,6 +83,6 @@ private:
QT_END_NAMESPACE
#endif // QT_NO_DRAGANDDROP
#endif // draganddrop
#endif // QWAYLANDDATADEVICEMANAGER_H

View File

@ -47,7 +47,7 @@
#include <QtCore/QDebug>
#ifndef QT_NO_DRAGANDDROP
#if QT_CONFIG(draganddrop)
QT_BEGIN_NAMESPACE
@ -184,4 +184,4 @@ int QWaylandMimeData::readData(int fd, QByteArray &data) const
QT_END_NAMESPACE
#endif // QT_NO_DRAGANDDROP
#endif // draganddrop

View File

@ -56,7 +56,7 @@
#include <QtWaylandClient/qtwaylandclientglobal.h>
#include <QtWaylandClient/private/qwayland-wayland.h>
#ifndef QT_NO_DRAGANDDROP
#if QT_CONFIG(draganddrop)
QT_BEGIN_NAMESPACE
namespace QtWaylandClient {
@ -106,5 +106,5 @@ private:
}
QT_END_NAMESPACE
#endif // QT_NO_DRAGANDDROP
#endif // draganddrop
#endif

View File

@ -49,7 +49,7 @@
#include <unistd.h>
#ifndef QT_NO_DRAGANDDROP
#if QT_CONFIG(draganddrop)
QT_BEGIN_NAMESPACE
@ -99,4 +99,4 @@ void QWaylandDataSource::data_source_target(const QString &mime_type)
QT_END_NAMESPACE
#endif // QT_NO_DRAGANDDROP
#endif // draganddrop

View File

@ -56,7 +56,7 @@
#include <QtWaylandClient/private/qwayland-wayland.h>
#include <QtWaylandClient/qtwaylandclientglobal.h>
#ifndef QT_NO_DRAGANDDROP
#if QT_CONFIG(draganddrop)
QT_BEGIN_NAMESPACE
@ -94,6 +94,6 @@ private:
QT_END_NAMESPACE
#endif // QT_NO_DRAGANDDROP
#endif // draganddrop
#endif // QWAYLANDDATASOURCE_H

View File

@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
namespace QtWaylandClient {
#ifndef QT_NO_LIBRARY
#if QT_CONFIG(library)
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QWaylandDecorationFactoryInterface_iid, QLatin1String("/wayland-decoration-client"), Qt::CaseInsensitive))
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
@ -57,7 +57,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
QStringList QWaylandDecorationFactory::keys(const QString &pluginPath)
{
#ifndef QT_NO_LIBRARY
#if QT_CONFIG(library)
QStringList list;
if (!pluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(pluginPath);
@ -80,7 +80,7 @@ QStringList QWaylandDecorationFactory::keys(const QString &pluginPath)
QWaylandAbstractDecoration *QWaylandDecorationFactory::create(const QString &name, const QStringList &args, const QString &pluginPath)
{
#ifndef QT_NO_LIBRARY
#if QT_CONFIG(library)
// Try loading the plugin from platformPluginPath first:
if (!pluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(pluginPath);

View File

@ -120,7 +120,7 @@ QWaylandWindowManagerIntegration *QWaylandDisplay::windowManagerIntegration() co
QWaylandDisplay::QWaylandDisplay(QWaylandIntegration *waylandIntegration)
: mWaylandIntegration(waylandIntegration)
#ifndef QT_NO_DRAGANDDROP
#if QT_CONFIG(draganddrop)
, mDndSelectionHandler(0)
#endif
, mWindowExtension(0)
@ -160,7 +160,7 @@ QWaylandDisplay::~QWaylandDisplay(void)
mWaylandIntegration->destroyScreen(screen);
}
mScreens.clear();
#ifndef QT_NO_DRAGANDDROP
#if QT_CONFIG(draganddrop)
delete mDndSelectionHandler.take();
#endif
wl_display_disconnect(mDisplay);
@ -255,7 +255,7 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin
} else if (interface == QStringLiteral("wl_seat")) {
QWaylandInputDevice *inputDevice = mWaylandIntegration->createInputDevice(this, version, id);
mInputDevices.append(inputDevice);
#ifndef QT_NO_DRAGANDDROP
#if QT_CONFIG(draganddrop)
} else if (interface == QStringLiteral("wl_data_device_manager")) {
mDndSelectionHandler.reset(new QWaylandDataDeviceManager(this, id));
#endif

View File

@ -137,7 +137,7 @@ public:
QList<QWaylandInputDevice *> inputDevices() const { return mInputDevices; }
QWaylandInputDevice *defaultInputDevice() const;
QWaylandInputDevice *currentInputDevice() const { return defaultInputDevice(); }
#ifndef QT_NO_DRAGANDDROP
#if QT_CONFIG(draganddrop)
QWaylandDataDeviceManager *dndSelectionHandler() const { return mDndSelectionHandler.data(); }
#endif
QtWayland::qt_surface_extension *windowExtension() const { return mWindowExtension.data(); }
@ -202,7 +202,7 @@ private:
QList<QWaylandInputDevice *> mInputDevices;
QList<Listener> mRegistryListeners;
QWaylandIntegration *mWaylandIntegration;
#ifndef QT_NO_DRAGANDDROP
#if QT_CONFIG(draganddrop)
QScopedPointer<QWaylandDataDeviceManager> mDndSelectionHandler;
#endif
QScopedPointer<QtWayland::qt_surface_extension> mWindowExtension;

View File

@ -50,7 +50,7 @@
#include <QDebug>
QT_BEGIN_NAMESPACE
#ifndef QT_NO_DRAGANDDROP
#if QT_CONFIG(draganddrop)
namespace QtWaylandClient {
QWaylandDrag::QWaylandDrag(QWaylandDisplay *display)
@ -131,5 +131,5 @@ void QWaylandDrag::finishDrag(const QPlatformDropQtResponse &response)
}
}
#endif // QT_NO_DRAGANDDROP
#endif // draganddrop
QT_END_NAMESPACE

View File

@ -64,7 +64,7 @@ QT_BEGIN_NAMESPACE
namespace QtWaylandClient {
class QWaylandDisplay;
#ifndef QT_NO_DRAGANDDROP
#if QT_CONFIG(draganddrop)
class Q_WAYLAND_CLIENT_EXPORT QWaylandDrag : public QBasicDrag
{
public:

View File

@ -190,7 +190,7 @@ QWaylandInputDevice::QWaylandInputDevice(QWaylandDisplay *display, int version,
, mSerial(0)
, mTouchDevice(0)
{
#ifndef QT_NO_DRAGANDDROP
#if QT_CONFIG(draganddrop)
if (mQDisplay->dndSelectionHandler()) {
mDataDevice = mQDisplay->dndSelectionHandler()->getDataDevice(this);
}

View File

@ -96,7 +96,7 @@ public:
const QByteArray desktopEnvironment = QGuiApplicationPrivate::platformIntegration()->services()->desktopEnvironment();
if (desktopEnvironment == QByteArrayLiteral("KDE")) {
#ifndef QT_NO_SETTINGS
#if QT_CONFIG(settings)
result.push_back(QStringLiteral("kde"));
#endif
} else if (!desktopEnvironment.isEmpty() &&
@ -122,7 +122,7 @@ QWaylandIntegration::QWaylandIntegration()
, mInputDeviceIntegration(Q_NULLPTR)
, mFontDb(new QGenericUnixFontDatabase())
, mNativeInterface(new QWaylandNativeInterface(this))
#ifndef QT_NO_ACCESSIBILITY
#if QT_CONFIG(accessibility)
, mAccessibility(new QPlatformAccessibility())
#endif
, mClientBufferIntegrationInitialized(false)
@ -131,7 +131,7 @@ QWaylandIntegration::QWaylandIntegration()
{
initializeInputDeviceIntegration();
mDisplay.reset(new QWaylandDisplay(this));
#ifndef QT_NO_DRAGANDDROP
#if QT_CONFIG(draganddrop)
mClipboard.reset(new QWaylandClipboard(mDisplay.data()));
mDrag.reset(new QWaylandDrag(mDisplay.data()));
#endif
@ -188,14 +188,14 @@ QPlatformWindow *QWaylandIntegration::createPlatformWindow(QWindow *window) cons
return new QWaylandShmWindow(window);
}
#ifndef QT_NO_OPENGL
#if QT_CONFIG(opengl)
QPlatformOpenGLContext *QWaylandIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
{
if (mDisplay->clientBufferIntegration())
return mDisplay->clientBufferIntegration()->createPlatformOpenGLContext(context->format(), context->shareHandle());
return 0;
}
#endif // QT_NO_OPENGL
#endif // opengl
QPlatformBackingStore *QWaylandIntegration::createPlatformBackingStore(QWindow *window) const
{
@ -223,7 +223,7 @@ QPlatformFontDatabase *QWaylandIntegration::fontDatabase() const
return mFontDb.data();
}
#ifndef QT_NO_DRAGANDDROP
#if QT_CONFIG(draganddrop)
QPlatformClipboard *QWaylandIntegration::clipboard() const
{
return mClipboard.data();
@ -233,7 +233,7 @@ QPlatformDrag *QWaylandIntegration::drag() const
{
return mDrag.data();
}
#endif // QT_NO_DRAGANDDROP
#endif // draganddrop
QPlatformInputContext *QWaylandIntegration::inputContext() const
{
@ -255,7 +255,7 @@ QVariant QWaylandIntegration::styleHint(StyleHint hint) const
return QPlatformIntegration::styleHint(hint);
}
#ifndef QT_NO_ACCESSIBILITY
#if QT_CONFIG(accessibility)
QPlatformAccessibility *QWaylandIntegration::accessibility() const
{
return mAccessibility.data();

View File

@ -75,7 +75,7 @@ public:
bool hasCapability(QPlatformIntegration::Capability cap) const Q_DECL_OVERRIDE;
QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE;
#ifndef QT_NO_OPENGL
#if QT_CONFIG(opengl)
QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const Q_DECL_OVERRIDE;
#endif
QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE;
@ -86,7 +86,7 @@ public:
QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE;
QPlatformNativeInterface *nativeInterface() const Q_DECL_OVERRIDE;
#ifndef QT_NO_DRAGANDDROP
#if QT_CONFIG(draganddrop)
QPlatformClipboard *clipboard() const Q_DECL_OVERRIDE;
QPlatformDrag *drag() const Q_DECL_OVERRIDE;
#endif
@ -94,7 +94,7 @@ public:
QVariant styleHint(StyleHint hint) const Q_DECL_OVERRIDE;
#ifndef QT_NO_ACCESSIBILITY
#if QT_CONFIG(accessibility)
QPlatformAccessibility *accessibility() const Q_DECL_OVERRIDE;
#endif
@ -126,14 +126,14 @@ private:
QWaylandShellIntegration *createShellIntegration(const QString& interfaceName);
QScopedPointer<QPlatformFontDatabase> mFontDb;
#ifndef QT_NO_DRAGANDDROP
#if QT_CONFIG(draganddrop)
QScopedPointer<QPlatformClipboard> mClipboard;
QScopedPointer<QPlatformDrag> mDrag;
#endif
QScopedPointer<QWaylandDisplay> mDisplay;
QScopedPointer<QPlatformNativeInterface> mNativeInterface;
QScopedPointer<QPlatformInputContext> mInputContext;
#ifndef QT_NO_ACCESSIBILITY
#if QT_CONFIG(accessibility)
QScopedPointer<QPlatformAccessibility> mAccessibility;
#endif
bool mClientBufferIntegrationInitialized;

View File

@ -116,7 +116,7 @@ void *QWaylandNativeInterface::nativeResourceForScreen(const QByteArray &resourc
return nullptr;
}
#ifndef QT_NO_OPENGL
#if QT_CONFIG(opengl)
void *QWaylandNativeInterface::nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context)
{
#if QT_CONFIG(opengl)
@ -134,7 +134,7 @@ void *QWaylandNativeInterface::nativeResourceForContext(const QByteArray &resour
return nullptr;
}
#endif // QT_NO_OPENGL
#endif // opengl
QVariantMap QWaylandNativeInterface::windowProperties(QPlatformWindow *window) const
{

View File

@ -72,7 +72,7 @@ public:
QWindow *window) Q_DECL_OVERRIDE;
void *nativeResourceForScreen(const QByteArray &resourceString,
QScreen *screen) Q_DECL_OVERRIDE;
#ifndef QT_NO_OPENGL
#if QT_CONFIG(opengl)
void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) Q_DECL_OVERRIDE;
#endif
QVariantMap windowProperties(QPlatformWindow *window) const Q_DECL_OVERRIDE;

View File

@ -348,7 +348,7 @@ QWaylandWindow *QWaylandShmBackingStore::waylandWindow() const
return static_cast<QWaylandWindow *>(window()->handle());
}
#ifndef QT_NO_OPENGL
#if QT_CONFIG(opengl)
QImage QWaylandShmBackingStore::toImage() const
{
// Invoked from QPlatformBackingStore::composeAndFlush() that is called
@ -357,7 +357,7 @@ QImage QWaylandShmBackingStore::toImage() const
return *contentSurface();
}
#endif // QT_NO_OPENGL
#endif // opengl
}

View File

@ -107,7 +107,7 @@ public:
QWaylandWindow *waylandWindow() const;
void iterateBuffer();
#ifndef QT_NO_OPENGL
#if QT_CONFIG(opengl)
QImage toImage() const Q_DECL_OVERRIDE;
#endif

View File

@ -795,7 +795,7 @@ void QWaylandWindow::requestActivateWindow()
void QWaylandWindow::unfocus()
{
#ifndef QT_NO_DRAGANDDROP
#if QT_CONFIG(draganddrop)
QWaylandInputDevice *inputDevice = mDisplay->currentInputDevice();
if (inputDevice && inputDevice->dataDevice()) {
inputDevice->dataDevice()->invalidateSelectionOffer();

View File

@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
namespace QtWaylandClient {
#ifndef QT_NO_LIBRARY
#if QT_CONFIG(library)
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QWaylandShellIntegrationFactoryInterface_iid, QLatin1String("/wayland-shell-integration"), Qt::CaseInsensitive))
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
@ -57,7 +57,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
QStringList QWaylandShellIntegrationFactory::keys(const QString &pluginPath)
{
#ifndef QT_NO_LIBRARY
#if QT_CONFIG(library)
QStringList list;
if (!pluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(pluginPath);
@ -80,7 +80,7 @@ QStringList QWaylandShellIntegrationFactory::keys(const QString &pluginPath)
QWaylandShellIntegration *QWaylandShellIntegrationFactory::create(const QString &name, const QStringList &args, const QString &pluginPath)
{
#ifndef QT_NO_LIBRARY
#if QT_CONFIG(library)
// Try loading the plugin from platformPluginPath first:
if (!pluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(pluginPath);