diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2016-04-24 19:34:38 +1000 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2016-04-24 19:34:38 +1000 |
commit | e972ff07d575958a22b952bcc957e5bac1863965 (patch) | |
tree | 6da9bff65eca942554eba8ea5ea2d38f38ff27f3 /ksmserver/shutdown.cpp | |
parent | 700426d3ab40fa9c1e1bb80fe559b0e03ea1f8de (diff) | |
download | tdebase-e972ff07d575958a22b952bcc957e5bac1863965.tar.gz tdebase-e972ff07d575958a22b952bcc957e5bac1863965.zip |
ksmserver: Added support for hybrid suspend (aka suspend to RAM + suspend to disk).
This relates to bug 2601.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'ksmserver/shutdown.cpp')
-rw-r--r-- | ksmserver/shutdown.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/ksmserver/shutdown.cpp b/ksmserver/shutdown.cpp index a40bffc3b..753703289 100644 --- a/ksmserver/shutdown.cpp +++ b/ksmserver/shutdown.cpp @@ -229,7 +229,7 @@ void KSMServer::shutdownInternal( TDEApplication::ShutdownConfirm confirm, // TODO: turn the feedback widget into a list of apps to be closed, // with an indicator of the current status for each. KSMShutdownFeedback::stop(); // make the screen become normal again - if (selection != 0) { + if (selection != SuspendType::NotSpecified) { // respect lock on resume & disable suspend/hibernate settings // from power-manager TDEConfig config("power-managerrc"); @@ -244,14 +244,19 @@ void KSMServer::shutdownInternal( TDEApplication::ShutdownConfirm confirm, #ifdef __TDE_HAVE_TDEHWLIB TDERootSystemDevice* rootDevice = hwDevices->rootSystemDevice(); if (rootDevice) { - if (selection == 1) { // Suspend - rootDevice->setPowerState(TDESystemPowerState::Suspend); - } - if (selection == 2) { // Hibernate - rootDevice->setPowerState(TDESystemPowerState::Hibernate); - } - if (selection == 3) { // Freeze - rootDevice->setPowerState(TDESystemPowerState::Freeze); + switch (selection) { + case SuspendType::Freeze: + rootDevice->setPowerState(TDESystemPowerState::Freeze); + break; + case SuspendType::Suspend: + rootDevice->setPowerState(TDESystemPowerState::Suspend); + break; + case SuspendType::Hibernate: + rootDevice->setPowerState(TDESystemPowerState::Hibernate); + break; + case SuspendType::HybridSuspend: + rootDevice->setPowerState(TDESystemPowerState::HybridSuspend); + break; } } #endif |