diff --git a/autotests/khintssettings_unittest.cpp b/autotests/khintssettings_unittest.cpp --- a/autotests/khintssettings_unittest.cpp +++ b/autotests/khintssettings_unittest.cpp @@ -51,7 +51,6 @@ QCOMPARE(hints.hint(QPlatformTheme::IconThemeSearchPaths).toStringList(), hints.xdgIconThemePaths()); const QStringList expectedStyles = QStringList{QStringLiteral(BREEZE_STYLE_NAME), QStringLiteral("oxygen"), QStringLiteral("fusion"), QStringLiteral("windows")}; - QEXPECT_FAIL("", "Empty entry included", Continue); QCOMPARE(hints.hint(QPlatformTheme::StyleNames).toStringList(), expectedStyles); QCOMPARE(hints.hint(QPlatformTheme::DialogButtonBoxLayout).toInt(), int(QDialogButtonBox::KdeLayout)); diff --git a/src/platformtheme/khintssettings.cpp b/src/platformtheme/khintssettings.cpp --- a/src/platformtheme/khintssettings.cpp +++ b/src/platformtheme/khintssettings.cpp @@ -90,12 +90,17 @@ m_hints[QPlatformTheme::SystemIconFallbackThemeName] = QStringLiteral("hicolor"); m_hints[QPlatformTheme::IconThemeSearchPaths] = xdgIconThemePaths(); - QStringList styleNames; - styleNames << cg.readEntry("widgetStyle", QString()) - << QStringLiteral(BREEZE_STYLE_NAME) - << QStringLiteral("oxygen") - << QStringLiteral("fusion") - << QStringLiteral("windows"); + QStringList styleNames{ + QStringLiteral(BREEZE_STYLE_NAME), + QStringLiteral("oxygen"), + QStringLiteral("fusion"), + QStringLiteral("windows") + }; + const QString configuredStyle = cg.readEntry("widgetStyle", QString()); + if (!configuredStyle.isEmpty()) { + styleNames.removeOne(configuredStyle); + styleNames.prepend(configuredStyle); + } const QString lnfStyle = readConfigValue(QStringLiteral("KDE"), QStringLiteral("widgetStyle"), QString()).toString(); if (!lnfStyle.isEmpty()) { styleNames.removeOne(lnfStyle);