diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2014-03-14 17:05:14 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2014-03-14 17:05:14 +0100 |
commit | 5960db66c9d2f1dbec8bef79ed793f729457b302 (patch) | |
tree | a4f9244642be73a9325c984a8c8f86b0ddcba002 /tdecore | |
parent | 6f5618209f0db9bd4ef170126ac618ecc7c68763 (diff) | |
download | tdelibs-5960db66c9d2f1dbec8bef79ed793f729457b302.tar.gz tdelibs-5960db66c9d2f1dbec8bef79ed793f729457b302.zip |
Fix use offerShutdown in TDE hardware library
This relates to Bug 1931
Diffstat (limited to 'tdecore')
-rw-r--r-- | tdecore/tdehw/tderootsystemdevice.cpp | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/tdecore/tdehw/tderootsystemdevice.cpp b/tdecore/tdehw/tderootsystemdevice.cpp index 3951aa7e1..3ece22106 100644 --- a/tdecore/tdehw/tderootsystemdevice.cpp +++ b/tdecore/tdehw/tderootsystemdevice.cpp @@ -442,11 +442,9 @@ bool TDERootSystemDevice::canHibernate() { } bool TDERootSystemDevice::canPowerOff() { - TDEConfig *config = TDEGlobal::config(); - config->reparseConfiguration(); // config may have changed in the KControl module - - config->setGroup("General" ); - if (!config->readBoolEntry( "offerShutdown", true )) { + TDEConfig config("ksmserverrc", true); + config.setGroup("General" ); + if (!config.readBoolEntry( "offerShutdown", true )) { return FALSE; } @@ -496,11 +494,9 @@ bool TDERootSystemDevice::canPowerOff() { } bool TDERootSystemDevice::canReboot() { - TDEConfig *config = TDEGlobal::config(); - config->reparseConfiguration(); // config may have changed in the KControl module - - config->setGroup("General" ); - if (!config->readBoolEntry( "offerShutdown", true )) { + TDEConfig config("ksmserverrc", true); + config.setGroup("General" ); + if (!config.readBoolEntry( "offerShutdown", true )) { return FALSE; } @@ -817,10 +813,9 @@ bool TDERootSystemDevice::setPowerState(TDESystemPowerState::TDESystemPowerState return false; } else if (ps == TDESystemPowerState::PowerOff) { - TDEConfig *config = TDEGlobal::config(); - config->reparseConfiguration(); // config may have changed in the KControl module - config->setGroup("General" ); - if (!config->readBoolEntry( "offerShutdown", true )) { + TDEConfig config("ksmserverrc", true); + config.setGroup("General" ); + if (!config.readBoolEntry( "offerShutdown", true )) { return false; } #ifdef WITH_LOGINDPOWER @@ -868,10 +863,9 @@ bool TDERootSystemDevice::setPowerState(TDESystemPowerState::TDESystemPowerState return false; } else if (ps == TDESystemPowerState::Reboot) { - TDEConfig *config = TDEGlobal::config(); - config->reparseConfiguration(); // config may have changed in the KControl module - config->setGroup("General" ); - if (!config->readBoolEntry( "offerShutdown", true )) { + TDEConfig config("ksmserverrc", true); + config.setGroup("General" ); + if (!config.readBoolEntry( "offerShutdown", true )) { return false; } #ifdef WITH_LOGINDPOWER |