summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Spoerl <[email protected]>2025-04-04 09:17:42 +0200
committerAxel Spoerl <[email protected]>2025-04-07 03:40:20 +0200
commitf86a0ccdfb808a036ccc2410c83971ea674158e0 (patch)
tree741d3bb2dc428fff1f1514bfe317aeb3ba103e5e
parentf4e892d79768a6c4da8acf42da954a8f2e611f4b (diff)
Remove double negation ifdefs in QGenericUnixTheme
Replace ifndef QT_NO_DBUS antipattern by if QT_CONFIG(dbus). Change-Id: Ifca080594358df0d836db25721b43ad31129cf48 Reviewed-by: Samuli Piippo <[email protected]>
-rw-r--r--src/gui/platform/unix/qgenericunixtheme.cpp18
-rw-r--r--src/gui/platform/unix/qgenericunixtheme_p.h6
2 files changed, 12 insertions, 12 deletions
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 <QSettings>
-#ifndef QT_NO_DBUS
+#if QT_CONFIG(dbus)
#include "qkdetheme_p.h"
#endif
#endif
@@ -32,7 +32,7 @@
#include <qpa/qplatformdialoghelper.h>
#include <qpa/qplatformtheme_p.h>
-#ifndef QT_NO_DBUS
+#if QT_CONFIG(dbus)
#include <QJsonDocument>
#include <QJsonArray>
#include <QJsonObject>
@@ -47,7 +47,7 @@
#include <private/qguiapplication_p.h>
#include <qpa/qplatformintegration.h>
#include <QtCore/QStandardPaths>
-#ifndef QT_NO_DBUS
+#if QT_CONFIG(dbus)
#include <QtDBus/QDBusConnectionInterface>
#include <private/qdbustrayicon_p.h>
#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<QByteArray> 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<QSize> 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)