From ed1740b8824ec2e405bb8c9ee7ac70afc9290633 Mon Sep 17 00:00:00 2001 From: Denis Kozadaev Date: Tue, 6 Jun 2023 21:15:57 +0300 Subject: [PATCH] fix patches for SunOS based systems Signed-off-by: Denis Kozadaev --- kcontrol/tdm/tdm-shut.cpp | 12 ++++++++++++ tdm/config.def | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/kcontrol/tdm/tdm-shut.cpp b/kcontrol/tdm/tdm-shut.cpp index 14e681d18..52cec1e36 100644 --- a/kcontrol/tdm/tdm-shut.cpp +++ b/kcontrol/tdm/tdm-shut.cpp @@ -208,9 +208,16 @@ void TDMSessionsWidget::load() readSD(sdrcombo, "Root"); config->setGroup("Shutdown"); +#if defined(Q_OS_SOLARIS) + restart_lined->setURL(config->readEntry("RebootCmd", "/usr/sbin/reboot")); +#else /* default */ restart_lined->setURL(config->readEntry("RebootCmd", "/sbin/reboot")); +#endif /* default */ + #if defined(__OpenBSD__) shutdown_lined->setURL(config->readEntry("HaltCmd", "/sbin/halt -p")); +#elif defined(Q_OS_SOLARIS) + shutdown_lined->setURL(config->readEntry("HaltCmd", "/usr/sbin/poweroff")); #else shutdown_lined->setURL(config->readEntry("HaltCmd", "/sbin/poweroff")); #endif @@ -222,8 +229,13 @@ void TDMSessionsWidget::load() void TDMSessionsWidget::defaults() { +#if defined(Q_OS_SOLARIS) + restart_lined->setURL("/usr/sbin/reboot"); + shutdown_lined->setURL("/usr/sbin/poweroff"); +#else /* default */ restart_lined->setURL("/sbin/reboot"); shutdown_lined->setURL("/sbin/poweroff"); +#endif /* default */ sdlcombo->setCurrentItem(SdAll); sdrcombo->setCurrentItem(SdRoot); diff --git a/tdm/config.def b/tdm/config.def index 7ffdd2376..6e43d5aad 100644 --- a/tdm/config.def +++ b/tdm/config.def @@ -39,7 +39,7 @@ #elif defined(BSD) # define HALT_CMD "/sbin/shutdown -h now" # define REBOOT_CMD "/sbin/shutdown -r now" -#elif defined(__SVR4) +#elif defined(__SVR4) || defined(Q_OS_SOLARIS) # define HALT_CMD "/usr/sbin/halt" # define REBOOT_CMD "/usr/sbin/reboot" #else