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
remotes/origin/Plasma/5.5
Martin Gräßlin 11 years ago
parent c408e9ccec
commit 5d37ccfce0
  1. 19
      kcmkwin/kwinscreenedges/main.cpp
  2. 1
      libkwineffects/kwinglobals.h
  3. 2
      screenedge.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()

@ -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
};

@ -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;
}

Loading…
Cancel
Save