[kcmkwin/kwindecoration] Fix save of theme name

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



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

Just happened to see it when doing a code review.

Diff Detail

R108 KWin
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
Restricted Application added a project: KWin. · View Herald TranscriptJan 10 2019, 12:14 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
davidedmundson requested review of this revision.Jan 10 2019, 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.Jan 10 2019, 12:18 AM
This revision is now accepted and ready to land.Jan 10 2019, 12:18 AM

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

(assuming HAVE_BREEZE is false)

If I set

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


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.