diff --git a/src/gui/platform/unix/qgenericunixtheme.cpp b/src/gui/platform/unix/qgenericunixtheme.cpp index bbe0fa6a5a7..afd2c4cd7de 100644 --- a/src/gui/platform/unix/qgenericunixtheme.cpp +++ b/src/gui/platform/unix/qgenericunixtheme.cpp @@ -21,7 +21,7 @@ #endif #if QT_CONFIG(settings) #include -#ifndef QT_NO_DBUS +#if QT_CONFIG(dbus) #include "qkdetheme_p.h" #endif #endif @@ -32,7 +32,7 @@ #include #include -#ifndef QT_NO_DBUS +#if QT_CONFIG(dbus) #include #include #include @@ -47,7 +47,7 @@ #include #include #include -#ifndef QT_NO_DBUS +#if QT_CONFIG(dbus) #include #include #endif @@ -96,7 +96,7 @@ const QFont *QGenericUnixTheme::font(Font type) const } } -#ifndef QT_NO_DBUS +#if QT_CONFIG(dbus) QPlatformMenuBar *QGenericUnixTheme::createPlatformMenuBar() const { if (isDBusGlobalMenuAvailable()) @@ -105,7 +105,7 @@ QPlatformMenuBar *QGenericUnixTheme::createPlatformMenuBar() const } #endif -#if !defined(QT_NO_DBUS) && !defined(QT_NO_SYSTEMTRAYICON) +#if QT_CONFIG(dbus) && QT_CONFIG(systemtrayicon) QPlatformSystemTrayIcon *QGenericUnixTheme::createPlatformSystemTrayIcon() const { if (shouldUseDBusTray()) @@ -161,7 +161,7 @@ QStringList QGenericUnixTheme::themeNames() << "LXDE"; const QList desktopNames = desktopEnvironment.split(':'); for (const QByteArray &desktopName : desktopNames) { -#if !defined QT_NO_DBUS && QT_CONFIG(settings) && (QT_CONFIG(xcb) || QT_CONFIG(wayland)) +#if QT_CONFIG(dbus) && QT_CONFIG(settings) && (QT_CONFIG(xcb) || QT_CONFIG(wayland)) if (desktopEnvironment == "KDE") { result.push_back(QLatin1StringView(QKdeTheme::name)); } else @@ -191,7 +191,7 @@ QPlatformTheme *QGenericUnixTheme::createUnixTheme(const QString &name) { if (name == QLatin1StringView(QGenericUnixTheme::name)) return new QGenericUnixTheme; -#if !defined QT_NO_DBUS && QT_CONFIG(settings) && (QT_CONFIG(xcb) || QT_CONFIG(wayland)) +#if QT_CONFIG(dbus) && QT_CONFIG(settings) && (QT_CONFIG(xcb) || QT_CONFIG(wayland)) if (name == QLatin1StringView(QKdeTheme::name)) return QKdeTheme::createKdeTheme(); #endif @@ -240,7 +240,7 @@ QSize QGenericUnixTheme::mouseCursorSize() return QSize(s, s); } -#ifndef QT_NO_DBUS +#if QT_CONFIG(dbus) static bool checkDBusGlobalMenuAvailable() { const QDBusConnection connection = QDBusConnection::sessionBus(); @@ -276,7 +276,7 @@ QIcon QGenericUnixTheme::xdgFileIcon(const QFileInfo &fileInfo) #endif -#if !defined(QT_NO_DBUS) && !defined(QT_NO_SYSTEMTRAYICON) +#if QT_CONFIG(dbus) && QT_CONFIG(systemtrayicon) bool QGenericUnixTheme::shouldUseDBusTray() { // There's no other tray implementation to fallback to on non-X11 diff --git a/src/gui/platform/unix/qgenericunixtheme_p.h b/src/gui/platform/unix/qgenericunixtheme_p.h index e0d089d9812..2d1a118b1ae 100644 --- a/src/gui/platform/unix/qgenericunixtheme_p.h +++ b/src/gui/platform/unix/qgenericunixtheme_p.h @@ -46,10 +46,10 @@ public: const QFont *font(Font type) const override; QVariant themeHint(ThemeHint hint) const override; -#ifndef QT_NO_DBUS +#if QT_CONFIG(dbus) QPlatformMenuBar *createPlatformMenuBar() const override; #endif -#if !defined(QT_NO_DBUS) && !defined(QT_NO_SYSTEMTRAYICON) +#if QT_CONFIG(dbus) && QT_CONFIG(systemtrayicon) QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const override; #endif @@ -72,7 +72,7 @@ protected: static QSize mouseCursorSize(); static QList availableXdgFileIconSizes(); -#if !defined(QT_NO_DBUS) && !defined(QT_NO_SYSTEMTRAYICON) +#if QT_CONFIG(dbus) && QT_CONFIG(systemtrayicon) static bool shouldUseDBusTray(); #endif #if QT_CONFIG(mimetype)