Remove double negation ifdefs in QGnometheme
Replace ifndef QT_NO_DBUS antipattern by if QT_CONFIG(dbus). Change-Id: I7dd44a6f5496e6f12c16ee1ecef3a004e5580d17 Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
This commit is contained in:
parent
f86a0ccdfb
commit
fa42c281ee
@ -4,7 +4,7 @@
|
||||
#include "qgnometheme_p.h"
|
||||
#include <qpa/qplatformdialoghelper.h>
|
||||
#include <qpa/qplatformfontdatabase.h>
|
||||
#ifndef QT_NO_DBUS
|
||||
#if QT_CONFIG(dbus)
|
||||
#include "qdbuslistener_p.h"
|
||||
#include <private/qdbustrayicon_p.h>
|
||||
#include <private/qdbustrayicon_p.h>
|
||||
@ -18,9 +18,9 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#ifndef QT_NO_DBUS
|
||||
#if QT_CONFIG(dbus)
|
||||
Q_STATIC_LOGGING_CATEGORY(lcQpaThemeGnome, "qt.qpa.theme.gnome")
|
||||
#endif // QT_NO_DBUS
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\class QGnomeTheme
|
||||
@ -33,7 +33,7 @@ const char *QGnomeTheme::name = "gnome";
|
||||
|
||||
QGnomeThemePrivate::QGnomeThemePrivate()
|
||||
{
|
||||
#ifndef QT_NO_DBUS
|
||||
#if QT_CONFIG(dbus)
|
||||
static constexpr QLatin1String appearanceNamespace("org.freedesktop.appearance");
|
||||
static constexpr QLatin1String colorSchemeKey("color-scheme");
|
||||
static constexpr QLatin1String contrastKey("contrast");
|
||||
@ -79,7 +79,7 @@ QGnomeThemePrivate::QGnomeThemePrivate()
|
||||
} else {
|
||||
qCWarning(lcQpaThemeGnome) << "dbus connection failed. Last error: " << dbus.lastError();
|
||||
}
|
||||
#endif // QT_NO_DBUS
|
||||
#endif // QT_CONFIG(dbus)
|
||||
}
|
||||
QGnomeThemePrivate::~QGnomeThemePrivate()
|
||||
{
|
||||
@ -102,7 +102,7 @@ void QGnomeThemePrivate::configureFonts(const QString >kFontName) const
|
||||
qCDebug(lcQpaFonts) << "default fonts: system" << systemFont << "fixed" << fixedFont;
|
||||
}
|
||||
|
||||
#ifndef QT_NO_DBUS
|
||||
#if QT_CONFIG(dbus)
|
||||
bool QGnomeThemePrivate::initDbus()
|
||||
{
|
||||
dbus.reset(new QDBusListener());
|
||||
@ -155,7 +155,7 @@ void QGnomeThemePrivate::updateHighContrast(Qt::ContrastPreference contrast)
|
||||
QWindowSystemInterface::handleThemeChange();
|
||||
}
|
||||
|
||||
#endif // QT_NO_DBUS
|
||||
#endif // QT_CONFIG(dbus)
|
||||
|
||||
QGnomeTheme::QGnomeTheme()
|
||||
: QGenericUnixTheme(new QGnomeThemePrivate())
|
||||
@ -236,7 +236,7 @@ QString QGnomeTheme::gtkFontName() const
|
||||
.arg(defaultSystemFontSize);
|
||||
}
|
||||
|
||||
#ifndef QT_NO_DBUS
|
||||
#if QT_CONFIG(dbus)
|
||||
QPlatformMenuBar *QGnomeTheme::createPlatformMenuBar() const
|
||||
{
|
||||
if (isDBusGlobalMenuAvailable())
|
||||
@ -256,7 +256,7 @@ Qt::ContrastPreference QGnomeTheme::contrastPreference() const
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined(QT_NO_DBUS) && !defined(QT_NO_SYSTEMTRAYICON)
|
||||
#if QT_CONFIG(dbus) && QT_CONFIG(systemtrayicon)
|
||||
QPlatformSystemTrayIcon *QGnomeTheme::createPlatformSystemTrayIcon() const
|
||||
{
|
||||
if (shouldUseDBusTray())
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QGnomeThemePrivate;
|
||||
#ifndef QT_NO_DBUS
|
||||
#if QT_CONFIG(dbus)
|
||||
class QDBusListener;
|
||||
#endif
|
||||
|
||||
@ -38,12 +38,12 @@ public:
|
||||
QString standardButtonText(int button) const override;
|
||||
|
||||
virtual QString gtkFontName() const;
|
||||
#ifndef QT_NO_DBUS
|
||||
#if QT_CONFIG(dbus)
|
||||
QPlatformMenuBar *createPlatformMenuBar() const override;
|
||||
Qt::ColorScheme colorScheme() const override;
|
||||
Qt::ContrastPreference contrastPreference() const override;
|
||||
#endif
|
||||
#if !defined(QT_NO_DBUS) && !defined(QT_NO_SYSTEMTRAYICON)
|
||||
#if QT_CONFIG(dbus) && QT_CONFIG(systemtrayicon)
|
||||
QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const override;
|
||||
#endif
|
||||
|
||||
@ -61,7 +61,7 @@ public:
|
||||
mutable QFont *systemFont = nullptr;
|
||||
mutable QFont *fixedFont = nullptr;
|
||||
|
||||
#ifndef QT_NO_DBUS
|
||||
#if QT_CONFIG(dbus)
|
||||
Qt::ColorScheme m_colorScheme = Qt::ColorScheme::Unknown;
|
||||
Qt::ContrastPreference m_contrast = Qt::ContrastPreference::NoPreference;
|
||||
private:
|
||||
@ -69,7 +69,7 @@ private:
|
||||
bool initDbus();
|
||||
void updateColorScheme(const QString &themeName);
|
||||
void updateHighContrast(Qt::ContrastPreference contrast);
|
||||
#endif // QT_NO_DBUS
|
||||
#endif // QT_CONFIG(dbus)
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user