Commit a314181f authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

userswitcher: Also use SessionManagement to lock the screen

This way we don't need the PowerDevil data engine anymore.
parent 283a76a1
Pipeline #229733 passed with stage
in 1 minute and 39 seconds
......@@ -114,17 +114,6 @@ Item {
Layout.maximumWidth: Layout.preferredWidth
Layout.maximumHeight: Screen.height / 2
PlasmaCore.DataSource {
id: pmEngine
engine: "powermanagement"
connectedSources: ["PowerDevil", "Sleep States"]
function performOperation(what) {
var service = serviceForSource("PowerDevil")
var operation = service.operationDescription(what)
service.startOperationCall(operation)
}
}
Sessions.SessionManagement {
id: sm
}
......@@ -222,12 +211,12 @@ Item {
id: lockScreenButton
text: i18nc("@action", "Lock Screen")
icon.name: "system-lock-screen"
visible: pmEngine.data["Sleep States"]["LockScreen"]
visible: sm.canLock
KeyNavigation.up: newSessionButton
KeyNavigation.down: leaveButton
onClicked: pmEngine.performOperation("lockScreen")
onClicked: sm.lock()
}
ActionListDelegate {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment