From 55480be88b83049c19e13598657ec9c5294bfc6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 20 Mar 2012 16:53:24 +0100 Subject: [PATCH] Remove Present Windows from TabBox KCM Present Windows is nowadays a layout so it should no longer appear in the effects replacement list. --- kcmkwin/kwintabbox/main.cpp | 37 ++++--------------------------------- kcmkwin/kwintabbox/main.h | 5 ++--- 2 files changed, 6 insertions(+), 36 deletions(-) diff --git a/kcmkwin/kwintabbox/main.cpp b/kcmkwin/kwintabbox/main.cpp index b13993dc57..945ad0390b 100644 --- a/kcmkwin/kwintabbox/main.cpp +++ b/kcmkwin/kwintabbox/main.cpp @@ -101,12 +101,8 @@ KWinTabBoxConfig::KWinTabBoxConfig(QWidget* parent, const QVariantList& args) // TODO: way to recognize if a effect is not found KServiceTypeTrader* trader = KServiceTypeTrader::self(); KService::List services; - QString presentwindows; QString coverswitch; QString flipswitch; - services = trader->query("KWin/Effect", "[X-KDE-PluginInfo-Name] == 'kwin4_effect_presentwindows'"); - if (!services.isEmpty()) - presentwindows = services.first()->name(); services = trader->query("KWin/Effect", "[X-KDE-PluginInfo-Name] == 'kwin4_effect_coverswitch'"); if (!services.isEmpty()) coverswitch = services.first()->name(); @@ -116,13 +112,11 @@ KWinTabBoxConfig::KWinTabBoxConfig(QWidget* parent, const QVariantList& args) m_primaryTabBoxUi->effectCombo->addItem(i18nc("ComboBox item for window switcher based on layouts instead of a desktop effect", "Layout based switcher")); - m_primaryTabBoxUi->effectCombo->addItem(presentwindows); m_primaryTabBoxUi->effectCombo->addItem(coverswitch); m_primaryTabBoxUi->effectCombo->addItem(flipswitch); m_alternativeTabBoxUi->effectCombo->addItem(i18nc("ComboBox item for window switcher based on layouts instead of a desktop effect", "Layout based switcher")); - m_alternativeTabBoxUi->effectCombo->addItem(presentwindows); m_alternativeTabBoxUi->effectCombo->addItem(coverswitch); m_alternativeTabBoxUi->effectCombo->addItem(flipswitch); @@ -201,13 +195,6 @@ void KWinTabBoxConfig::load() m_primaryTabBoxUi->effectCombo->setCurrentIndex(Layout); m_alternativeTabBoxUi->effectCombo->setCurrentIndex(Layout); KConfigGroup effectconfig(m_config, "Plugins"); - KConfigGroup presentwindowsconfig(m_config, "Effect-PresentWindows"); - if (effectEnabled("presentwindows", effectconfig)) { - if (presentwindowsconfig.readEntry("TabBox", false)) - m_primaryTabBoxUi->effectCombo->setCurrentIndex(PresentWindows); - if (presentwindowsconfig.readEntry("TabBoxAlternative", false)) - m_alternativeTabBoxUi->effectCombo->setCurrentIndex(PresentWindows); - } KConfigGroup coverswitchconfig(m_config, "Effect-CoverSwitch"); if (effectEnabled("coverswitch", effectconfig)) { if (coverswitchconfig.readEntry("TabBox", false)) @@ -310,22 +297,16 @@ void KWinTabBoxConfig::save() bool coverSwitchAlternative = false; bool flipSwitchAlternative = false; switch(m_primaryTabBoxUi->effectCombo->currentIndex()) { - case 1: - presentWindowSwitching = true; - break; - case 2: + case CoverSwitch: coverSwitch = true; break; - case 3: + case FlipSwitch: flipSwitch = true; break; default: break; // nothing } switch(m_alternativeTabBoxUi->effectCombo->currentIndex()) { - case PresentWindows: - presentWindowSwitchingAlternative = true; - break; case CoverSwitch: coverSwitchAlternative = true; break; @@ -347,10 +328,6 @@ void KWinTabBoxConfig::save() if (highlightWindows) effectconfig.writeEntry("kwin4_effect_highlightwindowEnabled", true); effectconfig.sync(); - KConfigGroup presentwindowsconfig(m_config, "Effect-PresentWindows"); - presentwindowsconfig.writeEntry("TabBox", presentWindowSwitching); - presentwindowsconfig.writeEntry("TabBoxAlternative", presentWindowSwitchingAlternative); - presentwindowsconfig.sync(); KConfigGroup coverswitchconfig(m_config, "Effect-CoverSwitch"); coverswitchconfig.writeEntry("TabBox", coverSwitch); coverswitchconfig.writeEntry("TabBoxAlternative", coverSwitchAlternative); @@ -487,13 +464,10 @@ void KWinTabBoxConfig::aboutEffectClicked(KWinTabBoxConfigForm* ui) KService::List services; QString effect; switch(ui->effectCombo->currentIndex()) { - case 1: - effect = "presentwindows"; - break; - case 2: + case CoverSwitch: effect = "coverswitch"; break; - case 3: + case FlipSwitch: effect = "flipswitch"; break; default: @@ -553,9 +527,6 @@ void KWinTabBoxConfig::configureEffectClicked(KWinTabBoxConfigForm* ui) { QString effect; switch(ui->effectCombo->currentIndex()) { - case PresentWindows: - effect = "presentwindows_config"; - break; case CoverSwitch: effect = "coverswitch_config"; break; diff --git a/kcmkwin/kwintabbox/main.h b/kcmkwin/kwintabbox/main.h index b178371e8b..b1e57e6609 100644 --- a/kcmkwin/kwintabbox/main.h +++ b/kcmkwin/kwintabbox/main.h @@ -85,9 +85,8 @@ private: private: enum Mode { Layout = 0, - PresentWindows = 1, - CoverSwitch = 2, - FlipSwitch = 3 + CoverSwitch = 1, + FlipSwitch = 2 }; KWinTabBoxConfigForm* m_primaryTabBoxUi; KWinTabBoxConfigForm* m_alternativeTabBoxUi;