diff options
author | Denis Kozadaev <[email protected]> | 2023-06-06 21:15:57 +0300 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2023-06-20 17:22:57 +0900 |
commit | c449ec1768b03e3e43b9c7f6a827b2d59b1e7ea0 (patch) | |
tree | a674670aa5463242417a4e909f77f823ad391555 /kcontrol | |
parent | 22937e157705c7d5c31e12ab0ce8551c322a3d2e (diff) | |
download | tdebase-c449ec1768b03e3e43b9c7f6a827b2d59b1e7ea0.tar.gz tdebase-c449ec1768b03e3e43b9c7f6a827b2d59b1e7ea0.zip |
Find power related system tools instead of hardcode them
Signed-off-by: Denis Kozadaev <[email protected]>
(cherry picked from commit 3c23abfd84440d769bc20707e04cb356ddb48c1a)
Diffstat (limited to 'kcontrol')
-rw-r--r-- | kcontrol/tdm/tdm-shut.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/kcontrol/tdm/tdm-shut.cpp b/kcontrol/tdm/tdm-shut.cpp index 14e681d18..da120ae4c 100644 --- a/kcontrol/tdm/tdm-shut.cpp +++ b/kcontrol/tdm/tdm-shut.cpp @@ -17,6 +17,8 @@ Boston, MA 02110-1301, USA. */ +#include "config.h" + #include <unistd.h> #include <sys/types.h> @@ -91,7 +93,7 @@ TDMSessionsWidget::TDMSessionsWidget(TQWidget *parent, const char *name) bm_combo = new KBackedComboBox( group4 ); bm_combo->insertItem("None", i18n("boot manager", "None")); bm_combo->insertItem("Grub", i18n("Grub")); -#if defined(__linux__) && ( defined(__i386__) || defined(__amd64__) ) +#if defined(Q_OS_LINUX) && ( defined(__i386__) || defined(__amd64__) ) bm_combo->insertItem("Lilo", i18n("Lilo")); #endif TQLabel *bm_label = new TQLabel( bm_combo, i18n("Boot manager:"), group4 ); @@ -208,12 +210,8 @@ void TDMSessionsWidget::load() readSD(sdrcombo, "Root"); config->setGroup("Shutdown"); - restart_lined->setURL(config->readEntry("RebootCmd", "/sbin/reboot")); -#if defined(__OpenBSD__) - shutdown_lined->setURL(config->readEntry("HaltCmd", "/sbin/halt -p")); -#else - shutdown_lined->setURL(config->readEntry("HaltCmd", "/sbin/poweroff")); -#endif + restart_lined->setURL(config->readEntry("RebootCmd", REBOOT_BINARY)); + shutdown_lined->setURL(config->readEntry("HaltCmd", POWEROFF_BINARY)); bm_combo->setCurrentId(config->readEntry("BootManager", "None")); } @@ -222,8 +220,8 @@ void TDMSessionsWidget::load() void TDMSessionsWidget::defaults() { - restart_lined->setURL("/sbin/reboot"); - shutdown_lined->setURL("/sbin/poweroff"); + restart_lined->setURL(REBOOT_BINARY); + shutdown_lined->setURL(POWEROFF_BINARY); sdlcombo->setCurrentItem(SdAll); sdrcombo->setCurrentItem(SdRoot); |