Browse Source

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 11 years ago
parent
commit
5a63d5945b
  1. 2
      ConfigureChecks.cmake
  2. 14
      ksmserver/shutdowndlg.cpp
  3. 7
      ksmserver/shutdowndlg.h

2
ConfigureChecks.cmake

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

14
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 )

7
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;
};

Loading…
Cancel
Save