Skip to content
Commit aac89c57 authored by Jakob Petsovits's avatar Jakob Petsovits Committed by Nicolas Fella
Browse files

Remove PowerButtonAction::SuspendHybrid enum value

We now have SleepMode::HybridSuspend, let's not lock ourselves
into also providing a PowerButtonAction that's equivalent to
PowerButtonAction::SuspendToRam + SleepMode::SuspendHybrid.
(I'd also like to rename PowerButtonAction::SuspendToRam to
PowerButtonAction::Sleep, but that's a separate task.)

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 another BatteryCriticalAction 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.
parent 49830cf1
Pipeline #533075 passed with stage
in 1 minute and 8 seconds
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