diff --git a/src/gui/platform/unix/qkdetheme.cpp b/src/gui/platform/unix/qkdetheme.cpp index af6edbc3f8f..9f91218612c 100644 --- a/src/gui/platform/unix/qkdetheme.cpp +++ b/src/gui/platform/unix/qkdetheme.cpp @@ -109,18 +109,18 @@ public: private: mutable QHash kdeSettings; -#ifndef QT_NO_DBUS +#if QT_CONFIG(dbus) std::unique_ptr dbus; bool initDbus(); void settingChangedHandler(QDBusListener::Provider provider, QDBusListener::Setting setting, const QVariant &value); Qt::ColorScheme colorSchemeFromPalette() const; -#endif // QT_NO_DBUS +#endif // QT_CONFIG(dbus) void clearResources(); }; -#ifndef QT_NO_DBUS +#if QT_CONFIG(dbus) void QKdeThemePrivate::settingChangedHandler(QDBusListener::Provider provider, QDBusListener::Setting setting, const QVariant &value) @@ -166,15 +166,15 @@ bool QKdeThemePrivate::initDbus() return QObject::connect(dbus.get(), &QDBusListener::settingChanged, dbus.get(), wrapper); } -#endif // QT_NO_DBUS +#endif // QT_CONFIG(dbus) QKdeThemePrivate::QKdeThemePrivate(const QStringList &kdeDirs, int kdeVersion) : kdeDirs(kdeDirs), kdeVersion(kdeVersion) { std::fill(fonts, fonts + QPlatformTheme::NFonts, static_cast(nullptr)); -#ifndef QT_NO_DBUS +#if QT_CONFIG(dbus) initDbus(); -#endif // QT_NO_DBUS +#endif // QT_CONFIG(dbus) } static constexpr QLatin1StringView settingsPrefix(QKdeThemePrivate::KdeSettingType type) @@ -812,7 +812,7 @@ QPlatformTheme *QKdeTheme::createKdeTheme() return new QKdeTheme(kdeDirs, kdeVersion); } -#ifndef QT_NO_DBUS +#if QT_CONFIG(dbus) QPlatformMenuBar *QKdeTheme::createPlatformMenuBar() const { if (isDBusGlobalMenuAvailable()) @@ -821,7 +821,7 @@ QPlatformMenuBar *QKdeTheme::createPlatformMenuBar() const } #endif -#if !defined(QT_NO_DBUS) && !defined(QT_NO_SYSTEMTRAYICON) +#if QT_CONFIG(dbus) && QT_CONFIG(systemtrayicon) QPlatformSystemTrayIcon *QKdeTheme::createPlatformSystemTrayIcon() const { if (shouldUseDBusTray()) diff --git a/src/gui/platform/unix/qkdetheme_p.h b/src/gui/platform/unix/qkdetheme_p.h index 006f557b4c1..212a79a7da8 100644 --- a/src/gui/platform/unix/qkdetheme_p.h +++ b/src/gui/platform/unix/qkdetheme_p.h @@ -43,10 +43,10 @@ public: void requestColorScheme(Qt::ColorScheme scheme) override; const QFont *font(Font type) 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