summaryrefslogtreecommitdiffstats
path: root/src/platformsupport
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-07-21 13:21:14 +0200
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-07-22 04:14:03 +0000
commitfa542b2ab66c39099c73ebf25eca9cca2070a8d8 (patch)
tree89e17cee4d1f1deef697e0816adf07d66a69bc36 /src/platformsupport
parent0e727823638eac011bbbf2c11bcf408b0badd2d1 (diff)
Fix creation of QPlatformTheme on UNIX platforms.
On Ubuntu 14.04.1 LTS, a file /etc/profile.d/appmenu-qt5.sh appeared, exporting QT_QPA_PLATFORMTHEME=appmenu-qt5 (application menu theme plugin). This caused QGenericUnixTheme::createUnixTheme() to return an instance of QGenericUnixTheme by theme name instead of the appropriate QKdeTheme, QGnomeTheme. Fix this by always appending the generic theme name to the list of available themes and returning it only if the name matches. Qt 5 applications will now appear correctly themed on Ubuntu, including theme icons. Change-Id: I68fcd80a620b74e2af73e938253dba9933816336 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
Diffstat (limited to 'src/platformsupport')
-rw-r--r--src/platformsupport/themes/genericunix/qgenericunixthemes.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
index ba328bfb41..2e17c3f63c 100644
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
@@ -678,7 +678,7 @@ QPlatformTheme *QGenericUnixTheme::createUnixTheme(const QString &name)
#endif
if (name == QLatin1String(QGnomeTheme::name))
return new QGnomeTheme;
- return new QGenericUnixTheme;
+ return Q_NULLPTR;
}
QStringList QGenericUnixTheme::themeNames()
@@ -710,8 +710,7 @@ QStringList QGenericUnixTheme::themeNames()
if (!session.isEmpty() && session != QLatin1String("default") && !result.contains(session))
result.push_back(session);
} // desktopSettingsAware
- if (result.isEmpty())
- result.push_back(QLatin1String(QGenericUnixTheme::name));
+ result.append(QLatin1String(QGenericUnixTheme::name));
return result;
}