From 14b827daaaad4e4b3f0c4036f8e90f9a7d91001e Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Thu, 10 Jan 2019 15:30:41 +0000 Subject: [PATCH] [kcmkwin/kwindecoration] Fix save of theme name 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. Reviewers: #kwin, vpilo Reviewed By: vpilo Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D18146 --- kcmkwin/kwindecoration/kcm.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/kcmkwin/kwindecoration/kcm.cpp b/kcmkwin/kwindecoration/kcm.cpp index 4804ce3eea..b0a6f00221 100644 --- a/kcmkwin/kwindecoration/kcm.cpp +++ b/kcmkwin/kwindecoration/kcm.cpp @@ -356,11 +356,7 @@ void ConfigurationModule::save() if (index.isValid()) { config.writeEntry("library", index.data(Qt::UserRole + 4).toString()); const QString theme = index.data(Qt::UserRole +5).toString(); - if (theme.isEmpty()) { - config.deleteEntry("theme"); - } else { - config.writeEntry("theme", theme); - } + config.writeEntry("theme", theme); } } }