summaryrefslogtreecommitdiffstats
path: root/ksmserver
diff options
context:
space:
mode:
Diffstat (limited to 'ksmserver')
-rw-r--r--ksmserver/server.cpp4
-rw-r--r--ksmserver/server.h4
-rw-r--r--ksmserver/shutdown.cpp4
-rw-r--r--ksmserver/shutdowndlg.cpp6
4 files changed, 16 insertions, 2 deletions
diff --git a/ksmserver/server.cpp b/ksmserver/server.cpp
index 257d5f20c..c9a037397 100644
--- a/ksmserver/server.cpp
+++ b/ksmserver/server.cpp
@@ -598,7 +598,9 @@ KSMServer::KSMServer( const TQString& windowManager, const TQString& windowManag
clientInteracting = 0;
xonCommand = config->readEntry( "xonCommand", "xon" );
+#ifdef __TDE_HAVE_TDEHWLIB
hwDevices = TDEGlobal::hardwareDevices();
+#endif
connect( &knotifyTimeoutTimer, TQT_SIGNAL( timeout()), TQT_SLOT( knotifyTimeout()));
connect( &startupSuspendTimeoutTimer, TQT_SIGNAL( timeout()), TQT_SLOT( startupSuspendTimeout()));
@@ -720,6 +722,7 @@ void KSMServer::cleanUp()
DM().shutdown( shutdownType, shutdownMode, bootOption );
}
else {
+#ifdef __TDE_HAVE_TDEHWLIB
TDERootSystemDevice* rootDevice = hwDevices->rootSystemDevice();
if (rootDevice) {
if (shutdownType == TDEApplication::ShutdownTypeHalt) {
@@ -729,6 +732,7 @@ void KSMServer::cleanUp()
rootDevice->setPowerState(TDESystemPowerState::Reboot);
}
}
+#endif
}
}
diff --git a/ksmserver/server.h b/ksmserver/server.h
index f5e0d37c6..bc677752c 100644
--- a/ksmserver/server.h
+++ b/ksmserver/server.h
@@ -23,7 +23,9 @@ Copyright (C) 2000 Matthias Ettrich <ettrich@kde.org>
#include <tqtimer.h>
#include <dcopobject.h>
+#ifdef __TDE_HAVE_TDEHWLIB
#include <tdehardwaredevices.h>
+#endif
#include "server2.h"
@@ -251,7 +253,9 @@ private:
WindowMap legacyWindows;
+#ifdef __TDE_HAVE_TDEHWLIB
TDEHardwareDevices* hwDevices;
+#endif
int initialClientCount;
int phase2ClientCount;
int protectionTimerCounter;
diff --git a/ksmserver/shutdown.cpp b/ksmserver/shutdown.cpp
index d7eaafb0e..a40bffc3b 100644
--- a/ksmserver/shutdown.cpp
+++ b/ksmserver/shutdown.cpp
@@ -152,6 +152,7 @@ bool KSMServer::checkStatus( bool &logoutConfirmed, bool &maysd, bool &mayrb,
mayrb = true;
}
else {
+#ifdef __TDE_HAVE_TDEHWLIB
TDERootSystemDevice* rootDevice = hwDevices->rootSystemDevice();
if (rootDevice) {
if (rootDevice->canPowerOff()) {
@@ -161,6 +162,7 @@ bool KSMServer::checkStatus( bool &logoutConfirmed, bool &maysd, bool &mayrb,
mayrb = true;
}
}
+#endif
}
}
if (!maysd) {
@@ -239,6 +241,7 @@ void KSMServer::shutdownInternal( TDEApplication::ShutdownConfirm confirm,
// If this is not done the desktop of the locked session will be shown after suspend/hibernate until the lock fully engages!
kapp->dcopClient()->call("kdesktop", "KScreensaverIface", "lock()", TQCString(""), replyType, replyData);
}
+#ifdef __TDE_HAVE_TDEHWLIB
TDERootSystemDevice* rootDevice = hwDevices->rootSystemDevice();
if (rootDevice) {
if (selection == 1) { // Suspend
@@ -251,6 +254,7 @@ void KSMServer::shutdownInternal( TDEApplication::ShutdownConfirm confirm,
rootDevice->setPowerState(TDESystemPowerState::Freeze);
}
}
+#endif
}
}
diff --git a/ksmserver/shutdowndlg.cpp b/ksmserver/shutdowndlg.cpp
index 6b3b02428..d4881ad85 100644
--- a/ksmserver/shutdowndlg.cpp
+++ b/ksmserver/shutdowndlg.cpp
@@ -33,7 +33,9 @@ Copyright (C) 2000 Matthias Ettrich <ettrich@kde.org>
#include <tdelocale.h>
#include <tdeconfig.h>
#include <tdeapplication.h>
+#ifdef __TDE_HAVE_TDEHWLIB
#include <tdehardwaredevices.h>
+#endif
#include <kdebug.h>
#include <kpushbutton.h>
#include <kstdguiitem.h>
@@ -805,7 +807,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
bool canSuspend = false;
bool canHibernate = false;
-#ifdef COMPILE_HALBACKEND
+#if defined(COMPILE_HALBACKEND)
// Query HAL for suspend/resume support
m_halCtx = libhal_ctx_new();
@@ -860,7 +862,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
canHibernate = true;
}
}
-#else // COMPILE_HALBACKEND
+#elif defined(__TDE_HAVE_TDEHWLIB) // COMPILE_HALBACKEND
TDERootSystemDevice* rootDevice = TDEGlobal::hardwareDevices()->rootSystemDevice();
if (rootDevice) {
canFreeze = rootDevice->canFreeze();