From 107220694fe3387df4051dcd94ae6c9995cb45f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sat, 18 Oct 2014 14:19:37 +0200 Subject: Allow contitional build with tdehwlib MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- ksmserver/server.cpp | 4 ++++ ksmserver/server.h | 4 ++++ ksmserver/shutdown.cpp | 4 ++++ ksmserver/shutdowndlg.cpp | 6 ++++-- 4 files changed, 16 insertions(+), 2 deletions(-) (limited to 'ksmserver') 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 #include #include +#ifdef __TDE_HAVE_TDEHWLIB #include +#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 #include #include #include +#ifdef __TDE_HAVE_TDEHWLIB #include +#endif #include #include #include @@ -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(); -- cgit v1.2.1