diff options
author | Axel Spoerl <[email protected]> | 2025-04-04 09:20:18 +0200 |
---|---|---|
committer | Axel Spoerl <[email protected]> | 2025-04-07 03:40:20 +0200 |
commit | 2bbf6aa2b87755f260faffb111a676ef16d4d936 (patch) | |
tree | 7cf4e52b61a078a375a94a90542c99266244dfa5 | |
parent | fa42c281ee671f517c48390cc8e91f98b0e84d56 (diff) |
Remove double negation ifdefs in QKdeTheme
Replace ifndef QT_NO_DBUS antipattern by if QT_CONFIG(dbus).
Change-Id: I186c779f3c4ed36a1fb082993e792e9c28ee20f0
Reviewed-by: Samuli Piippo <[email protected]>
-rw-r--r-- | src/gui/platform/unix/qkdetheme.cpp | 16 | ||||
-rw-r--r-- | src/gui/platform/unix/qkdetheme_p.h | 4 |
2 files changed, 10 insertions, 10 deletions
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<QString, QSettings *> kdeSettings; -#ifndef QT_NO_DBUS +#if QT_CONFIG(dbus) std::unique_ptr<QDBusListener> 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<QFont *>(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 |