Remove PowerButtonAction::SuspendHybrid enum value
I found some time on the plane for a few more follow-up patches to !259 (merged). This is imho the most important/pressing one. Not an improvement per se, but keeps our options open for after the official releases. First choice of reviewer would be @nicolasfella as he's got the recent config background, having reviewed my KConfigXT patches among other work he's done.
We now have SleepMode::HybridSuspend
, to be used with
PowerButtonAction::SuspendToRam
. Let's not lock ourselves into
also providing a PowerButtonAction that achieves the same thing
but needs a separate code path.
(I'd also like to rename PowerButtonAction::SuspendToRam
to
PowerButtonAction::Sleep
, but that's a separate task / upcoming MR.)
With these changes, the SuspendSession action now supports a "SleepMode"
argument
explicitly passed to SuspendSession::triggerImpl()
. If absent,
it will continue to use the current profile's SleepMode.
For the existing "suspendHybrid"
and "suspendToRam"
D-Bus methods
of SuspendSession, triggerImpl()
is called with this extra
"SleepMode"
argument. FdoConnector also had an implementation for
SuspendHybrid()
, but it didn't exist in the D-Bus XML specification
so I removed it there instead.
The SuspendHybrid
value is not used anymore in config files:
-
For ProfileSettings, the KConfigXT migration transformed it into
PowerButtonAction::SuspendToRam
+SleepMode::HybridSuspend
. -
For GlobalSettings (
BatteryCriticalAction
),SuspendHybrid
did not exist as an option in Plasma 5. I only recently allowed this when introducing PowerButtonActionModel in commit dfab5705 two months ago for Plasma 6 pre-alpha, i.e. never released. We can undo this. People who were using the dev version and newly selected "Hybrid Sleep" there will have it reverted by a temporary addition to migrateConfig(), which we can drop after or even before Plasma 6.0. We expect these developers to rebuild and run PowerDevil at least once after this commit. Those who don't can still select anotherBatteryCriticalAction
manually later.
So without any use, we can remove the actual enum value as well.
We'll still want BatteryCriticalAction to have hybrid suspend as an option in the long run, but we can figure out its data representation and UI later. Perhaps we'll want to present it similar to other power state profiles, where SleepMode is a separate control.