[kcmkwin/kwindecoration] Fix save of theme name
ClosedPublic

Authored by davidedmundson on Thu, Jan 10, 12:14 AM.

Details

Summary

If a user saves a decoration that has a plugin but no theme we currently
delete the entry saving just the plugin/library.

This is an issue as on load we call:

const QString plugin = config.readEntry("library", s_defaultPlugin);
const QString theme = config.readEntry("theme", s_defaultTheme);

That would give us a non-default library with the default theme name,
which would be invalid.

If compiled with Breeze s_defaultTheme is blank so this ends up being
effectively the same thing. In the normal case it will neither break
nor fix anything.

Test Plan

None.
Just happened to see it when doing a code review.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
Restricted Application added a project: KWin. · View Herald TranscriptThu, Jan 10, 12:14 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
davidedmundson requested review of this revision.Thu, Jan 10, 12:14 AM

It's not a big deal, as after the deletion in load() we would anyway end up getting the default s_defaultTheme, but 👍 for consistency

vpilo accepted this revision.Thu, Jan 10, 12:18 AM
This revision is now accepted and ready to land.Thu, Jan 10, 12:18 AM

That's the issue, we don't want the default.

(assuming HAVE_BREEZE is false)

If I set
library="myAwesomeLib"
theme=""

I want to load that, I don't want to end up loading

library="myAwesomeLib"
theme="kwin4_decoration_qml_plastik"

Ah - of course, the combination of theme and plugin is used to match the selection. Right.

This revision was automatically updated to reflect the committed changes.