Allow kdebase to build with HAL disabled

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1252060 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent 21fc43f2d4
commit 5a63d5945b

@ -36,7 +36,7 @@ endif( )
# hal (ksmserver, kioslaves) # hal (ksmserver, kioslaves)
if( BUILD_KSMSERVER OR (WITH_HAL AND BUILD_KIOSLAVES)) if( WITH_HAL )
pkg_search_module( HAL hal ) pkg_search_module( HAL hal )
if( NOT HAL_FOUND ) if( NOT HAL_FOUND )
tde_message_fatal( "hal is required, but was not found on your system" ) tde_message_fatal( "hal is required, but was not found on your system" )

@ -5,8 +5,6 @@ Copyright (C) 2010 Timothy Pearson <kb9vqf@pearsoncomputing.net>
Copyright (C) 2000 Matthias Ettrich <ettrich@kde.org> Copyright (C) 2000 Matthias Ettrich <ettrich@kde.org>
******************************************************************/ ******************************************************************/
#include <config.h>
#include "shutdowndlg.h" #include "shutdowndlg.h"
#include <tqapplication.h> #include <tqapplication.h>
#include <tqlayout.h> #include <tqlayout.h>
@ -708,8 +706,9 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
} }
#ifdef COMPILE_HALBACKEND
m_halCtx = NULL; m_halCtx = NULL;
#endif
if (maysd) { if (maysd) {
@ -723,6 +722,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
bool canSuspend = false; bool canSuspend = false;
bool canHibernate = false; bool canHibernate = false;
#ifdef COMPILE_HALBACKEND
// Query HAL for suspend/resume support // Query HAL for suspend/resume support
m_halCtx = libhal_ctx_new(); m_halCtx = libhal_ctx_new();
@ -777,7 +777,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
canHibernate = true; canHibernate = true;
} }
} }
#endif
if(doUbuntuLogout) { if(doUbuntuLogout) {
@ -976,6 +976,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent,
KSMShutdownDlg::~KSMShutdownDlg() KSMShutdownDlg::~KSMShutdownDlg()
{ {
#ifdef COMPILE_HALBACKEND
if (m_halCtx) if (m_halCtx)
{ {
DBusError error; DBusError error;
@ -983,6 +984,7 @@ KSMShutdownDlg::~KSMShutdownDlg()
libhal_ctx_shutdown(m_halCtx, &error); libhal_ctx_shutdown(m_halCtx, &error);
libhal_ctx_free(m_halCtx); libhal_ctx_free(m_halCtx);
} }
#endif
} }
@ -1019,6 +1021,7 @@ void KSMShutdownDlg::slotHalt()
void KSMShutdownDlg::slotSuspend() void KSMShutdownDlg::slotSuspend()
{ {
#ifdef COMPILE_HALBACKEND
if (m_lockOnResume) { if (m_lockOnResume) {
DCOPRef("kdesktop", "KScreensaverIface").send("lock"); DCOPRef("kdesktop", "KScreensaverIface").send("lock");
} }
@ -1040,10 +1043,12 @@ void KSMShutdownDlg::slotSuspend()
} }
reject(); // continue on resume reject(); // continue on resume
#endif
} }
void KSMShutdownDlg::slotHibernate() void KSMShutdownDlg::slotHibernate()
{ {
#ifdef COMPILE_HALBACKEND
if (m_lockOnResume) { if (m_lockOnResume) {
DCOPRef("kdesktop", "KScreensaverIface").send("lock"); DCOPRef("kdesktop", "KScreensaverIface").send("lock");
} }
@ -1062,6 +1067,7 @@ void KSMShutdownDlg::slotHibernate()
} }
reject(); // continue on resume reject(); // continue on resume
#endif
} }
bool KSMShutdownDlg::confirmShutdown( bool maysd, KApplication::ShutdownType& sdtype, TQString& bootOption ) bool KSMShutdownDlg::confirmShutdown( bool maysd, KApplication::ShutdownType& sdtype, TQString& bootOption )

@ -26,18 +26,21 @@ class TQPainter;
class TQString; class TQString;
class KAction; class KAction;
#include "timed.h" #include "timed.h"
#include <kapplication.h> #include <kapplication.h>
#include <kpixmapio.h> #include <kpixmapio.h>
#include <config.h>
#ifndef NO_QT3_DBUS_SUPPORT #ifndef NO_QT3_DBUS_SUPPORT
/* We acknowledge the the dbus API is unstable */ /* We acknowledge the the dbus API is unstable */
#define DBUS_API_SUBJECT_TO_CHANGE #define DBUS_API_SUBJECT_TO_CHANGE
#include <dbus/connection.h> #include <dbus/connection.h>
#endif // NO_QT3_DBUS_SUPPORT #endif // NO_QT3_DBUS_SUPPORT
#ifdef COMPILE_HALBACKEND
#include <hal/libhal.h> #include <hal/libhal.h>
#endif
// The (singleton) widget that makes/fades the desktop gray. // The (singleton) widget that makes/fades the desktop gray.
class KSMShutdownFeedback : public TQWidget class KSMShutdownFeedback : public TQWidget
@ -128,8 +131,10 @@ private:
TQString m_bootOption; TQString m_bootOption;
TQPopupMenu *targets; TQPopupMenu *targets;
TQStringList rebootOptions; TQStringList rebootOptions;
#ifdef COMPILE_HALBACKEND
LibHalContext* m_halCtx; LibHalContext* m_halCtx;
DBusConnection *m_dbusConn; DBusConnection *m_dbusConn;
#endif
bool m_lockOnResume; bool m_lockOnResume;
}; };

Loading…
Cancel
Save