Duplicate suspend handling code in plasma-workspace and powerdevil
Both plasma-workspace and powerdevil have code for talking to logind/consolekit for handling suspending.
plasma-workspace code: https://invent.kde.org/plasma/plasma-workspace/-/blob/master/libkworkspace/sessionmanagement.h
powerdevil code: https://invent.kde.org/plasma/powerdevil/-/blob/master/daemon/backends/upower/powerdevilupowerbackend.cpp
Conceptually the code does pretty much the same, it checks available suspend modes and suspends.
The implementations diverge however, as can be seen in plasma-workspace!3219 (merged)
We should probably unify that.
Options:
-
Make PowerDevil use KWorkspace API
-
Make Plasma DBus-call to Powerdevil to do suspend stuff