diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2022-02-12 00:17:53 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2022-02-14 01:07:37 +0900 |
commit | f9f7aee79eecdb610d71a8f2703de43e90018e5b (patch) | |
tree | dbb7075651157c6fad1d0aa027b503c95b5aa2e7 /ksmserver | |
parent | f1df18afb54fd214430a2eb8416f632ffb8c64d1 (diff) | |
download | tdebase-f9f7aee79eecdb610d71a8f2703de43e90018e5b.tar.gz tdebase-f9f7aee79eecdb610d71a8f2703de43e90018e5b.zip |
Removed HAL dependant code.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'ksmserver')
-rw-r--r-- | ksmserver/CMakeLists.txt | 5 | ||||
-rw-r--r-- | ksmserver/Makefile.am | 6 | ||||
-rw-r--r-- | ksmserver/shutdowndlg.cpp | 128 | ||||
-rw-r--r-- | ksmserver/shutdowndlg.h | 14 |
4 files changed, 6 insertions, 147 deletions
diff --git a/ksmserver/CMakeLists.txt b/ksmserver/CMakeLists.txt index 37bd9cfaf..aa6681f28 100644 --- a/ksmserver/CMakeLists.txt +++ b/ksmserver/CMakeLists.txt @@ -25,13 +25,10 @@ include_directories( ${CMAKE_SOURCE_DIR}/tdmlib ${TDE_INCLUDE_DIR} ${TQT_INCLUDE_DIRS} - ${DBUS_TQT_INCLUDE_DIRS} - ${HAL_INCLUDE_DIRS} ) link_directories( ${TQT_LIBRARY_DIRS} - ${DBUS_TQT_LIBRARY_DIRS} ) @@ -50,5 +47,5 @@ tde_add_tdeinit_executable( ksmserver AUTOMOC main.cpp server.cpp shutdowndlg.cpp startupdlg.cpp legacy.cpp startup.cpp shutdown.cpp client.cpp KSMServerInterface.skel server.skel timed.ui - LINK dmctl-static tdeui-shared tdersync-shared ${TDEHW_LIBRARIES} ${HAL_LIBRARIES} ${DBUS_TQT_LIBRARIES} + LINK dmctl-static tdeui-shared tdersync-shared ${TDEHW_LIBRARIES} ) diff --git a/ksmserver/Makefile.am b/ksmserver/Makefile.am index 8f1a236e4..2c2fa237d 100644 --- a/ksmserver/Makefile.am +++ b/ksmserver/Makefile.am @@ -17,7 +17,7 @@ SUBDIRS = . -INCLUDES= -I$(top_srcdir)/tdmlib $(all_includes) $(HAL_INCS) $(DBUS_INCS) +INCLUDES= -I$(top_srcdir)/tdmlib $(all_includes) bin_PROGRAMS = lib_LTLIBRARIES = @@ -31,7 +31,7 @@ ksmserver_la_SOURCES = main.cpp server.cpp shutdowndlg.cpp \ KSMServerInterface.skel server.skel timed.ui ksmserver_la_LDFLAGS = $(all_libraries) -avoid-version -module -ksmserver_la_LIBADD = ../tdmlib/libdmctl.la $(LIB_TDEUI) $(HAL_LIBS) $(DBUS_LIBS) +ksmserver_la_LIBADD = ../tdmlib/libdmctl.la $(LIB_TDEUI) picsdir = $(kde_datadir)/ksmserver/pics pics_DATA = shutdownkonq.png @@ -44,7 +44,7 @@ updatedir = $(kde_datadir)/tdeconf_update EXTRA_PROGRAMS = testsh testsh_SOURCES = test.cpp timed.ui testsh_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_TQT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor -testsh_LDADD = $(LIB_TDEUI) shutdowndlg.lo ../tdmlib/libdmctl.la $(HAL_LIBS) $(DBUS_LIBS) +testsh_LDADD = $(LIB_TDEUI) shutdowndlg.lo ../tdmlib/libdmctl.la messages: $(XGETTEXT) *.cpp -o $(podir)/ksmserver.pot diff --git a/ksmserver/shutdowndlg.cpp b/ksmserver/shutdowndlg.cpp index a794388c3..97287ede0 100644 --- a/ksmserver/shutdowndlg.cpp +++ b/ksmserver/shutdowndlg.cpp @@ -797,10 +797,6 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent, connect(btnLogout, TQT_SIGNAL(clicked()), TQT_SLOT(slotLogout())); } -#ifdef COMPILE_HALBACKEND - m_halCtx = NULL; -#endif - if ((maysd) || (mayrb)) { // respect lock on resume & disable suspend/hibernate settings @@ -815,70 +811,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent, bool canHibernate = false; bool canHybridSuspend = false; -#if defined(COMPILE_HALBACKEND) - // Query HAL for suspend/resume support - m_halCtx = libhal_ctx_new(); - - DBusError error; - dbus_error_init(&error); - m_dbusConn = dbus_connection_open_private(DBUS_SYSTEM_BUS, &error); - if (!m_dbusConn) - { - dbus_error_free(&error); - libhal_ctx_free(m_halCtx); - m_halCtx = NULL; - } - else - { - dbus_bus_register(m_dbusConn, &error); - if (dbus_error_is_set(&error)) - { - dbus_error_free(&error); - libhal_ctx_free(m_halCtx); - m_dbusConn = NULL; - m_halCtx = NULL; - } - else - { - libhal_ctx_set_dbus_connection(m_halCtx, m_dbusConn); - if (!libhal_ctx_init(m_halCtx, &error)) - { - if (dbus_error_is_set(&error)) - dbus_error_free(&error); - libhal_ctx_free(m_halCtx); - m_dbusConn = NULL; - m_halCtx = NULL; - } - } - } - - if (m_halCtx) - { - if (libhal_device_get_property_bool(m_halCtx, - "/org/freedesktop/Hal/devices/computer", - "power_management.can_suspend", - NULL)) - { - canSuspend = true; - } - - if (libhal_device_get_property_bool(m_halCtx, - "/org/freedesktop/Hal/devices/computer", - "power_management.can_hibernate", - NULL)) - { - canHibernate = true; - } - - if (libhal_device_get_property_bool(m_halCtx, - "/org/freedesktop/Hal/devices/computer", - "power_management.can_suspend_hybrid", - NULL)) - { - canHybridSuspend = true; - } - } -#elif defined(WITH_TDEHWLIB) // COMPILE_HALBACKEND +#if defined(WITH_TDEHWLIB) TDERootSystemDevice* rootDevice = TDEGlobal::hardwareDevices()->rootSystemDevice(); if (rootDevice) { canFreeze = rootDevice->canFreeze(); @@ -892,7 +825,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent, canHibernate = false; canHybridSuspend = false; } -#endif // COMPILE_HALBACKEND +#endif if(doUbuntuLogout) { // Ubuntu style logout window @@ -1175,15 +1108,6 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent, KSMShutdownDlg::~KSMShutdownDlg() { -#ifdef COMPILE_HALBACKEND - if (m_halCtx) - { - DBusError error; - dbus_error_init(&error); - libhal_ctx_shutdown(m_halCtx, &error); - libhal_ctx_free(m_halCtx); - } -#endif } @@ -1220,46 +1144,13 @@ void KSMShutdownDlg::slotHalt() void KSMShutdownDlg::slotSuspend() { -#ifndef COMPILE_HALBACKEND *m_selection = SuspendType::Suspend; -#else - if (m_dbusConn) - { - DBusMessage *msg = dbus_message_new_method_call( - "org.freedesktop.Hal", - "/org/freedesktop/Hal/devices/computer", - "org.freedesktop.Hal.Device.SystemPowerManagement", - "Suspend"); - - int wakeup=0; - dbus_message_append_args(msg, DBUS_TYPE_INT32, &wakeup, DBUS_TYPE_INVALID); - - dbus_connection_send(m_dbusConn, msg, NULL); - - dbus_message_unref(msg); - } -#endif reject(); // continue on resume } void KSMShutdownDlg::slotHibernate() { -#ifndef COMPILE_HALBACKEND *m_selection = SuspendType::Hibernate; -#else - if (m_dbusConn) - { - DBusMessage *msg = dbus_message_new_method_call( - "org.freedesktop.Hal", - "/org/freedesktop/Hal/devices/computer", - "org.freedesktop.Hal.Device.SystemPowerManagement", - "Hibernate"); - - dbus_connection_send(m_dbusConn, msg, NULL); - - dbus_message_unref(msg); - } -#endif reject(); // continue on resume } @@ -1271,22 +1162,7 @@ void KSMShutdownDlg::slotFreeze() void KSMShutdownDlg::slotHybridSuspend() { -#ifndef COMPILE_HALBACKEND *m_selection = SuspendType::HybridSuspend; -#else - if (m_dbusConn) - { - DBusMessage *msg = dbus_message_new_method_call( - "org.freedesktop.Hal", - "/org/freedesktop/Hal/devices/computer", - "org.freedesktop.Hal.Device.SystemPowerManagement", - "SuspendHybrid"); - - dbus_connection_send(m_dbusConn, msg, NULL); - - dbus_message_unref(msg); - } -#endif reject(); // continue on resume } diff --git a/ksmserver/shutdowndlg.h b/ksmserver/shutdowndlg.h index 25ee60f77..e92b6c3cd 100644 --- a/ksmserver/shutdowndlg.h +++ b/ksmserver/shutdowndlg.h @@ -34,16 +34,6 @@ class TDEAction; #include <config.h> -#ifdef COMPILE_HALBACKEND - #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 - - #include <hal/libhal.h> -#endif // COMPILE_HALBACKEND - namespace SuspendType { enum SuspendType { NotSpecified = 0, @@ -159,10 +149,6 @@ private: TQString m_bootOption; TQPopupMenu *targets; TQStringList rebootOptions; -#ifdef COMPILE_HALBACKEND - LibHalContext* m_halCtx; - DBusConnection *m_dbusConn; -#endif bool m_lockOnResume; int* m_selection; }; |