summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Gräßlin <mgraesslin@kde.org>2012-03-01 12:12:15 (GMT)
committerMartin Gräßlin <mgraesslin@kde.org>2012-03-04 15:35:55 (GMT)
commit05e1ee03e8b2dcd8e7a7563ca36f4fc01299e570 (patch)
tree2f4b1853a0bf7d7930dddd597c665a5b7464f324
parent201285b1cef4a54fedad8c2e75900d05ebf345cb (diff)
Ensure that update script does not overwrite settings
The upgrade script changed to thumbnails layout in case that there has not been any settings for BoxSwitch effect stored in the config file. REVIEW: 104129
-rw-r--r--kwin/data/update_tabbox_qml_settings.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/kwin/data/update_tabbox_qml_settings.cpp b/kwin/data/update_tabbox_qml_settings.cpp
index 618b36f..7297fff 100644
--- a/kwin/data/update_tabbox_qml_settings.cpp
+++ b/kwin/data/update_tabbox_qml_settings.cpp
@@ -46,9 +46,11 @@ int main( int argc, char* argv[] )
KComponentData inst( &about );
Q_UNUSED( KGlobal::locale() ); // jump-start locales to get to translated descriptions
KConfig config("kwinrc");
+ KConfigGroup plugins = config.group("Plugins");
+ const bool boxSwitchEnabled = plugins.readEntry<bool>("kwin4_effect_boxswitchEnabled", true);
KConfigGroup boxswitch = config.group("Effect-BoxSwitch");
- const bool boxSwitchPrimary = boxswitch.readEntry<bool>("TabBox", true);
- const bool boxSwitchAlternative = boxswitch.readEntry<bool>("TabBoxAlternative", false);
+ const bool boxSwitchPrimary = boxSwitchEnabled && boxswitch.hasKey("TabBox") && boxswitch.readEntry<bool>("TabBox", true);
+ const bool boxSwitchAlternative = boxSwitchEnabled && boxswitch.hasKey("TabBoxAlternative") && boxswitch.readEntry<bool>("TabBoxAlternative", false);
boxswitch.writeEntry("TabBox", false);
boxswitch.writeEntry("TabBoxAlternative", false);
boxswitch.sync();