diff options
Diffstat (limited to 'tdecore/tdehw/tdehardwaredevices.cpp')
-rw-r--r-- | tdecore/tdehw/tdehardwaredevices.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/tdecore/tdehw/tdehardwaredevices.cpp b/tdecore/tdehw/tdehardwaredevices.cpp index 1d8a4280b..c636e0888 100644 --- a/tdecore/tdehw/tdehardwaredevices.cpp +++ b/tdecore/tdehw/tdehardwaredevices.cpp @@ -3352,8 +3352,9 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice* exist TQFileInfo *dirfi; TDESystemPowerStateList powerstates; TDESystemHibernationMethodList hibernationmethods; - TDESystemHibernationMethod::TDESystemHibernationMethod hibernationmethod = + TDESystemHibernationMethod::TDESystemHibernationMethod hibernationmethod = TDESystemHibernationMethod::Unsupported; + TDESystemSuspendModeList suspendmodes; while ( (dirfi = valuesdirit.current()) != 0 ) { nodename = dirfi->fileName(); TQFile file( valuesnodename + nodename ); @@ -3372,7 +3373,7 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice* exist powerstates.append(TDESystemPowerState::Freeze); } if (line.contains("mem")) { - powerstates.append(TDESystemPowerState::Suspend); + powerstates.append(TDESystemPowerState::Mem); } if (line.contains("disk")) { powerstates.append(TDESystemPowerState::Disk); @@ -3421,6 +3422,17 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice* exist hibernationmethod = TDESystemHibernationMethod::Test; } } + if (nodename == "mem_sleep") { + if (line.contains("s2idle")) { + suspendmodes.append(TDESystemSuspendMode::SuspendToIdle); + } + if (line.contains("shallow")) { + suspendmodes.append(TDESystemSuspendMode::Standby); + } + if (line.contains("deep")) { + suspendmodes.append(TDESystemSuspendMode::SuspendToRAM); + } + } if (nodename == "image_size") { rdevice->internalSetDiskSpaceNeededForHibernation(line.toULong()); } @@ -3428,11 +3440,17 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice* exist } ++valuesdirit; } + // Suspend-to-RAM requires a combination of 'mem' and 'deep' in two different files + if (powerstates.contains(TDESystemPowerState::Mem) && + suspendmodes.contains(TDESystemSuspendMode::SuspendToRAM)) { + powerstates.append(TDESystemPowerState::Suspend); + powerstates.remove(TDESystemPowerState::Mem); + } // Hibernation and Hybrid Suspend are not real power states, being just two different // ways of suspending to disk. Since they are very common and it is very convenient to // treat them as power states, we do so, as other power frameworks also do. if (powerstates.contains(TDESystemPowerState::Disk) && - hibernationmethods.contains(TDESystemHibernationMethod::Platform)) { + hibernationmethods.contains(TDESystemHibernationMethod::Shutdown)) { powerstates.append(TDESystemPowerState::Hibernate); } if (powerstates.contains(TDESystemPowerState::Disk) && |