Commit 9313c877 authored by Cyril Rossi's avatar Cyril Rossi
Browse files

Fix issue when there is no WidgetStyle value in kdeglobals

Summary:
KConfig XT does not store default values in conf files. KCM Style applying default style, KHintsSetting expect a value in kdeglobals or ignore the notify change.
fix to provide a default value to allow applying default widget style.

Reviewers: #plasma, ervin, bport, mart

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D24918
parent 5cad9b01
......@@ -313,17 +313,17 @@ void KHintsSettings::slotNotifyChange(int type, int arg)
return;
}
const QString theme = readConfigValue(cg, QStringLiteral("widgetStyle"), QString()).toString();
if (theme.isEmpty()) {
return;
}
// HOTFIX here. Hardcoded default value is duplicated and may be inconsistent with the one actually defined in kcm_style kcfg
const QString theme = readConfigValue(cg, QStringLiteral("widgetStyle"), QStringLiteral(BREEZE_STYLE_NAME)).toString();
QStringList styleNames;
styleNames << theme
<< QStringLiteral(BREEZE_STYLE_NAME)
<< QStringLiteral("oxygen")
<< QStringLiteral("fusion")
<< QStringLiteral("windows");
if (theme != QStringLiteral(BREEZE_STYLE_NAME)) {
styleNames << theme;
}
styleNames << QStringLiteral(BREEZE_STYLE_NAME)
<< QStringLiteral("oxygen")
<< QStringLiteral("fusion")
<< QStringLiteral("windows");
const QString lnfStyle = readConfigValue(QStringLiteral("KDE"), QStringLiteral("widgetStyle"), QString()).toString();
if (!lnfStyle.isEmpty() && !styleNames.contains(lnfStyle)) {
styleNames.prepend(lnfStyle);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment