Commit 646e0a74 authored by David Redondo's avatar David Redondo 🏎 Committed by Christoph Cullmann
Browse files

Read the user visible name of the default color scheme

The user visible name and the name of a colorscheme as configured in kdeglobals
can differ. For example "Breeze Light" and "BreezeLight". This causes no color
scheme to be checked when such a scheme is the default scheme and no color
scheme has been selected in Kate.


(cherry picked from commit ad2e9867)
parent f8247706
......@@ -79,7 +79,12 @@ QString KateColorSchemeChooser::currentDesktopDefaultScheme() const
{
KSharedConfigPtr config = KSharedConfig::openConfig(QStringLiteral("kdeglobals"));
KConfigGroup group(config, "General");
return group.readEntry("ColorScheme", QStringLiteral("Breeze"));
const QString scheme = group.readEntry("ColorScheme", QStringLiteral("Breeze"));
const QString path = QStandardPaths::locate(QStandardPaths::GenericDataLocation,
QStringLiteral("color-schemes/%1.colors").arg(scheme));
KSharedConfigPtr schemeFile = KSharedConfig::openConfig(path, KConfig::SimpleConfig);
const QString name = KConfigGroup(schemeFile, "General").readEntry("Name", scheme);
return name;
}
QString KateColorSchemeChooser::currentSchemeName() const
......
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