summaryrefslogtreecommitdiffstats
path: root/ksmserver
diff options
context:
space:
mode:
Diffstat (limited to 'ksmserver')
-rw-r--r--ksmserver/shutdowndlg.cpp14
-rw-r--r--ksmserver/shutdowndlg.h7
2 files changed, 16 insertions, 5 deletions
diff --git a/ksmserver/shutdowndlg.cpp b/ksmserver/shutdowndlg.cpp
index 8a7693528..3deffdb71 100644
--- a/ksmserver/shutdowndlg.cpp
+++ b/ksmserver/shutdowndlg.cpp
@@ -5,8 +5,6 @@ Copyright (C) 2010 Timothy Pearson <kb9vqf@pearsoncomputing.net>
Copyright (C) 2000 Matthias Ettrich <ettrich@kde.org>
******************************************************************/
-#include <config.h>
-
#include "shutdowndlg.h"
#include <tqapplication.h>
#include <tqlayout.h>
@@ -708,8 +706,9 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
}
-
+#ifdef COMPILE_HALBACKEND
m_halCtx = NULL;
+#endif
if (maysd) {
@@ -723,6 +722,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
bool canSuspend = false;
bool canHibernate = false;
+#ifdef COMPILE_HALBACKEND
// Query HAL for suspend/resume support
m_halCtx = libhal_ctx_new();
@@ -777,7 +777,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
canHibernate = true;
}
}
-
+#endif
if(doUbuntuLogout) {
@@ -976,6 +976,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
KSMShutdownDlg::~KSMShutdownDlg()
{
+#ifdef COMPILE_HALBACKEND
if (m_halCtx)
{
DBusError error;
@@ -983,6 +984,7 @@ KSMShutdownDlg::~KSMShutdownDlg()
libhal_ctx_shutdown(m_halCtx, &error);
libhal_ctx_free(m_halCtx);
}
+#endif
}
@@ -1019,6 +1021,7 @@ void KSMShutdownDlg::slotHalt()
void KSMShutdownDlg::slotSuspend()
{
+#ifdef COMPILE_HALBACKEND
if (m_lockOnResume) {
DCOPRef("kdesktop", "KScreensaverIface").send("lock");
}
@@ -1040,10 +1043,12 @@ void KSMShutdownDlg::slotSuspend()
}
reject(); // continue on resume
+#endif
}
void KSMShutdownDlg::slotHibernate()
{
+#ifdef COMPILE_HALBACKEND
if (m_lockOnResume) {
DCOPRef("kdesktop", "KScreensaverIface").send("lock");
}
@@ -1062,6 +1067,7 @@ void KSMShutdownDlg::slotHibernate()
}
reject(); // continue on resume
+#endif
}
bool KSMShutdownDlg::confirmShutdown( bool maysd, KApplication::ShutdownType& sdtype, TQString& bootOption )
diff --git a/ksmserver/shutdowndlg.h b/ksmserver/shutdowndlg.h
index e6bcfdab2..0db328a79 100644
--- a/ksmserver/shutdowndlg.h
+++ b/ksmserver/shutdowndlg.h
@@ -26,18 +26,21 @@ class TQPainter;
class TQString;
class KAction;
-
#include "timed.h"
#include <kapplication.h>
#include <kpixmapio.h>
+#include <config.h>
+
#ifndef NO_QT3_DBUS_SUPPORT
/* We acknowledge the the dbus API is unstable */
#define DBUS_API_SUBJECT_TO_CHANGE
#include <dbus/connection.h>
#endif // NO_QT3_DBUS_SUPPORT
+#ifdef COMPILE_HALBACKEND
#include <hal/libhal.h>
+#endif
// The (singleton) widget that makes/fades the desktop gray.
class KSMShutdownFeedback : public TQWidget
@@ -128,8 +131,10 @@ private:
TQString m_bootOption;
TQPopupMenu *targets;
TQStringList rebootOptions;
+#ifdef COMPILE_HALBACKEND
LibHalContext* m_halCtx;
DBusConnection *m_dbusConn;
+#endif
bool m_lockOnResume;
};