|
Lines 442-452
bool TDERootSystemDevice::canHibernate() {
Link Here
|
| 442 |
} |
442 |
} |
| 443 |
|
443 |
|
| 444 |
bool TDERootSystemDevice::canPowerOff() { |
444 |
bool TDERootSystemDevice::canPowerOff() { |
| 445 |
TDEConfig *config = TDEGlobal::config(); |
445 |
TDEConfig config("ksmserverrc", true); |
| 446 |
config->reparseConfiguration(); // config may have changed in the KControl module |
446 |
config.setGroup("General" ); |
| 447 |
|
447 |
if (!config.readBoolEntry( "offerShutdown", true )) { |
| 448 |
config->setGroup("General" ); |
|
|
| 449 |
if (!config->readBoolEntry( "offerShutdown", true )) { |
| 450 |
return FALSE; |
448 |
return FALSE; |
| 451 |
} |
449 |
} |
| 452 |
|
450 |
|
|
Lines 496-506
bool TDERootSystemDevice::canPowerOff() {
Link Here
|
| 496 |
} |
494 |
} |
| 497 |
|
495 |
|
| 498 |
bool TDERootSystemDevice::canReboot() { |
496 |
bool TDERootSystemDevice::canReboot() { |
| 499 |
TDEConfig *config = TDEGlobal::config(); |
497 |
TDEConfig config("ksmserverrc", true); |
| 500 |
config->reparseConfiguration(); // config may have changed in the KControl module |
498 |
config.setGroup("General" ); |
| 501 |
|
499 |
if (!config.readBoolEntry( "offerShutdown", true )) { |
| 502 |
config->setGroup("General" ); |
|
|
| 503 |
if (!config->readBoolEntry( "offerShutdown", true )) { |
| 504 |
return FALSE; |
500 |
return FALSE; |
| 505 |
} |
501 |
} |
| 506 |
|
502 |
|
|
Lines 817-826
bool TDERootSystemDevice::setPowerState(TDESystemPowerState::TDESystemPowerState
Link Here
|
| 817 |
return false; |
813 |
return false; |
| 818 |
} |
814 |
} |
| 819 |
else if (ps == TDESystemPowerState::PowerOff) { |
815 |
else if (ps == TDESystemPowerState::PowerOff) { |
| 820 |
TDEConfig *config = TDEGlobal::config(); |
816 |
TDEConfig config("ksmserverrc", true); |
| 821 |
config->reparseConfiguration(); // config may have changed in the KControl module |
817 |
config.setGroup("General" ); |
| 822 |
config->setGroup("General" ); |
818 |
if (!config.readBoolEntry( "offerShutdown", true )) { |
| 823 |
if (!config->readBoolEntry( "offerShutdown", true )) { |
|
|
| 824 |
return false; |
819 |
return false; |
| 825 |
} |
820 |
} |
| 826 |
#ifdef WITH_LOGINDPOWER |
821 |
#ifdef WITH_LOGINDPOWER |
|
Lines 868-877
bool TDERootSystemDevice::setPowerState(TDESystemPowerState::TDESystemPowerState
Link Here
|
| 868 |
return false; |
863 |
return false; |
| 869 |
} |
864 |
} |
| 870 |
else if (ps == TDESystemPowerState::Reboot) { |
865 |
else if (ps == TDESystemPowerState::Reboot) { |
| 871 |
TDEConfig *config = TDEGlobal::config(); |
866 |
TDEConfig config("ksmserverrc", true); |
| 872 |
config->reparseConfiguration(); // config may have changed in the KControl module |
867 |
config.setGroup("General" ); |
| 873 |
config->setGroup("General" ); |
868 |
if (!config.readBoolEntry( "offerShutdown", true )) { |
| 874 |
if (!config->readBoolEntry( "offerShutdown", true )) { |
|
|
| 875 |
return false; |
869 |
return false; |
| 876 |
} |
870 |
} |
| 877 |
#ifdef WITH_LOGINDPOWER |
871 |
#ifdef WITH_LOGINDPOWER |