summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Spoerl <[email protected]>2025-03-26 12:54:05 +0100
committerAxel Spoerl <[email protected]>2025-03-27 11:14:51 +0100
commitc04b95cb591f711538facfd8ab39c1050ed49ebe (patch)
tree0f3504c4cd2e25cdf7612a8cd14105644b8a16d0
parent34be5083bddffc38b3034ac8a04b5b6b698d5e4e (diff)
QGenericUnixTheme: Fix build w/o xcb and wayland
Add ifdef condition to consider QKdeTheme only if Qt is built either with wayland or xcb. Fixes: QTBUG-135204 Change-Id: I27941bf6bd576c1532ac23992c1c94f9ace53683 Reviewed-by: Samuli Piippo <[email protected]>
-rw-r--r--src/gui/platform/unix/qgenericunixtheme.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/platform/unix/qgenericunixtheme.cpp b/src/gui/platform/unix/qgenericunixtheme.cpp
index d704a3541cc..bbe0fa6a5a7 100644
--- a/src/gui/platform/unix/qgenericunixtheme.cpp
+++ b/src/gui/platform/unix/qgenericunixtheme.cpp
@@ -161,11 +161,12 @@ 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 (desktopEnvironment == "KDE") {
-#if !defined QT_NO_DBUS && QT_CONFIG(settings)
result.push_back(QLatin1StringView(QKdeTheme::name));
+ } else
#endif
- } else if (gtkBasedEnvironments.contains(desktopName)) {
+ if (gtkBasedEnvironments.contains(desktopName)) {
// prefer the GTK3 theme implementation with native dialogs etc.
result.push_back(QStringLiteral("gtk3"));
// fallback to the generic Gnome theme if loading the GTK3 theme fails
@@ -190,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)
+#if !defined QT_NO_DBUS && QT_CONFIG(settings) && (QT_CONFIG(xcb) || QT_CONFIG(wayland))
if (name == QLatin1StringView(QKdeTheme::name))
return QKdeTheme::createKdeTheme();
#endif