summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/themes
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2012-11-20 09:13:50 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-20 17:08:39 +0100
commitf439108c4f6e456d329a666fe5000d07538b63c1 (patch)
treeb133a672e48c91746fc7bcdeeb7e8585b14d03be /src/platformsupport/themes
parente4b36acf1183a70907d570afc60ee4b17d03119e (diff)
Detect Unity by checking XDG_CURRENT_DESKTOP and use Gnome theme.
Fallback to Gtk for unknown desktops, which should be suitable for most cases like XFCE. Task-number: QTCREATORBUG-8254 Change-Id: Iaf9959f75852e03a83b5af7d0dead01ef657d678 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Diffstat (limited to 'src/platformsupport/themes')
-rw-r--r--src/platformsupport/themes/genericunix/qgenericunixthemes.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
index a39f26efc8..d773bc8c8e 100644
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
@@ -420,11 +420,12 @@ QStringList QGenericUnixTheme::themeNames()
{
QStringList result;
if (QGuiApplication::desktopSettingsAware()) {
- if (QGuiApplicationPrivate::platformIntegration()->services()->desktopEnvironment() == QByteArray("KDE")) {
+ const QByteArray desktopEnvironment = QGuiApplicationPrivate::platformIntegration()->services()->desktopEnvironment();
+ if (desktopEnvironment == QByteArrayLiteral("KDE")) {
#ifndef QT_NO_SETTINGS
result.push_back(QLatin1String(QKdeTheme::name));
#endif
- } else if (QGuiApplicationPrivate::platformIntegration()->services()->desktopEnvironment() == QByteArray("GNOME")) {
+ } else { // Gnome, Unity, other Gtk-based desktops like XFCE.
result.push_back(QLatin1String(QGnomeTheme::name));
}
const QString session = QString::fromLocal8Bit(qgetenv("DESKTOP_SESSION"));