From 5d37ccfce0907f4e8a393ae20c87d71fa65d9f9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 19 Oct 2015 15:57:16 +0200 Subject: [PATCH] Drop PreventScreenLocking electric border It was broken on so many ways, it's unbelievable: * action was read but did nothing * config was saved into a different file than read from REVIEW: 125701 CCBUG: 331841 --- kcmkwin/kwinscreenedges/main.cpp | 19 ------------------- libkwineffects/kwinglobals.h | 1 - screenedge.cpp | 2 -- 3 files changed, 22 deletions(-) diff --git a/kcmkwin/kwinscreenedges/main.cpp b/kcmkwin/kwinscreenedges/main.cpp index 50f5e6b523..ce7b571614 100644 --- a/kcmkwin/kwinscreenedges/main.cpp +++ b/kcmkwin/kwinscreenedges/main.cpp @@ -187,12 +187,6 @@ void KWinScreenEdgesConfig::monitorInit() monitorAddItem(i18n("No Action")); monitorAddItem(i18n("Show Desktop")); monitorAddItem(i18n("Lock Screen")); - monitorAddItem(i18n("Prevent Screen Locking")); - //Prevent Screen Locking is not supported on some edges - m_ui->monitor->setEdgeItemEnabled(int(Monitor::Top), 3, false); - m_ui->monitor->setEdgeItemEnabled(int(Monitor::Left), 3, false); - m_ui->monitor->setEdgeItemEnabled(int(Monitor::Right), 3, false); - m_ui->monitor->setEdgeItemEnabled(int(Monitor::Bottom), 3, false); // Add the effects const QString presentWindowsName = BuiltInEffects::effectData(BuiltInEffect::PresentWindows).displayName; @@ -217,7 +211,6 @@ void KWinScreenEdgesConfig::monitorLoadAction(ElectricBorder edge, const QString QString lowerName = config.readEntry(configName, "None").toLower(); if (lowerName == "showdesktop") monitorChangeEdge(edge, int(ElectricActionShowDesktop)); else if (lowerName == "lockscreen") monitorChangeEdge(edge, int(ElectricActionLockScreen)); - else if (lowerName == "preventscreenlocking") monitorChangeEdge(edge, int(ElectricActionPreventScreenLocking)); } void KWinScreenEdgesConfig::monitorLoad() @@ -314,20 +307,8 @@ void KWinScreenEdgesConfig::monitorSaveAction(int edge, const QString& configNam config.writeEntry(configName, "ShowDesktop"); else if (item == 2) config.writeEntry(configName, "LockScreen"); - else if (item == 3) - config.writeEntry(configName, "PreventScreenLocking"); else // Anything else config.writeEntry(configName, "None"); - - if ((edge == int(Monitor::TopRight)) || - (edge == int(Monitor::BottomRight)) || - (edge == int(Monitor::BottomLeft)) || - (edge == int(Monitor::TopLeft))) { - KConfig scrnConfig("kscreensaverrc"); - KConfigGroup scrnGroup = scrnConfig.group("ScreenSaver"); - scrnGroup.writeEntry("Action" + configName, (item == 3) ? 2 /* Prevent Screen Locking */ : 0 /* None */); - scrnGroup.sync(); - } } void KWinScreenEdgesConfig::monitorSave() diff --git a/libkwineffects/kwinglobals.h b/libkwineffects/kwinglobals.h index c65bb29907..3d833b760d 100644 --- a/libkwineffects/kwinglobals.h +++ b/libkwineffects/kwinglobals.h @@ -93,7 +93,6 @@ enum ElectricBorderAction { ElectricActionNone, // No special action, not set, desktop switch or an effect ElectricActionShowDesktop, // Show desktop or restore ElectricActionLockScreen, // Lock screen - ElectricActionPreventScreenLocking, ELECTRIC_ACTION_COUNT }; diff --git a/screenedge.cpp b/screenedge.cpp index 72dcb62f10..1bbead6bf1 100644 --- a/screenedge.cpp +++ b/screenedge.cpp @@ -670,8 +670,6 @@ static ElectricBorderAction electricBorderAction(const QString& name) return ElectricActionShowDesktop; } else if (lowerName == QStringLiteral("lockscreen")) { return ElectricActionLockScreen; - } else if (lowerName == QStringLiteral("preventscreenlocking")) { - return ElectricActionPreventScreenLocking; } return ElectricActionNone; }