diff --git a/CMakeLists.txt b/CMakeLists.txt index a6ffc2fb1..9f806656f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,7 +118,6 @@ OPTION( WITH_INOTIFY "Enable inotify support for tdeio" ON ) OPTION( WITH_GAMIN "Enable FAM/GAMIN support" ${WITH_ALL_OPTIONS} ) OPTION( WITH_TDEHWLIB "Enable TDE hwlib globally" ON ) OPTION( WITH_TDEHWLIB_DAEMONS "Enable daemons for TDE hwlib" ${WITH_TDEHWLIB} ) -OPTION( WITH_HAL "Enable HAL support" OFF ) OPTION( WITH_DEVKITPOWER "Enable DeviceKit Power support" OFF ) OPTION( WITH_LOGINDPOWER "Enable Logind/Systemd Power support" OFF ) OPTION( WITH_UPOWER "Enable uPower support" ${WITH_ALL_OPTIONS} ) diff --git a/tdecore/tdehw/CMakeLists.txt b/tdecore/tdehw/CMakeLists.txt index d314b055f..1951b0d16 100644 --- a/tdecore/tdehw/CMakeLists.txt +++ b/tdecore/tdehw/CMakeLists.txt @@ -17,7 +17,7 @@ if( NOT DBUS_SYSTEM_BUS ) set( DBUS_SYSTEM_BUS "unix:path=/var/run/dbus/system_bus_socket" CACHE INTERNAL "" FORCE ) endif() -if( WITH_TDEHWLIB_DAEMONS OR WITH_HAL OR WITH_DEVKITPOWER OR WITH_UPOWER OR WITH_UDISKS OR WITH_UDISKS2 OR +if( WITH_TDEHWLIB_DAEMONS OR WITH_DEVKITPOWER OR WITH_UPOWER OR WITH_UDISKS OR WITH_UDISKS2 OR WITH_NETWORK_MANAGER_BACKEND OR WITH_CONSOLEKIT ) list( APPEND TDEHW_CUSTOM_INCLUDE_DIRS ${DBUS_TQT_INCLUDE_DIRS} ) list( APPEND TDEHW_CUSTOM_LIBRARY_DIRS ${DBUS_TQT_LIBRARY_DIRS} ) @@ -28,10 +28,6 @@ if( WITH_TDEHWLIB_DAEMONS ) add_definitions( -DWITH_TDEHWLIB_DAEMONS ) endif( ) -if( WITH_HAL ) - add_definitions( -DWITH_HAL ) -endif( ) - if( WITH_DEVKITPOWER ) add_definitions( -DWITH_DEVKITPOWER ) endif( ) diff --git a/tdecore/tdehw/tdecpudevice.cpp b/tdecore/tdehw/tdecpudevice.cpp index 40b9ad6e2..6715000a0 100644 --- a/tdecore/tdehw/tdecpudevice.cpp +++ b/tdecore/tdehw/tdecpudevice.cpp @@ -30,13 +30,13 @@ #include "config.h" // uPower -#if defined(WITH_TDEHWLIB_DAEMONS) || defined(WITH_HAL) +#if defined(WITH_TDEHWLIB_DAEMONS) #include #include #include #include #include -#endif // defined(WITH_TDEHWLIB_DAEMONS) || defined(WITH_HAL) +#endif TDECPUDevice::TDECPUDevice(TDEGenericDeviceType::TDEGenericDeviceType dt, TQString dn) : TDEGenericDevice(dt, dn) { @@ -151,23 +151,6 @@ bool TDECPUDevice::canSetGovernor() { } #endif // WITH_TDEHWLIB_DAEMONS -#ifdef WITH_HAL - { - TQT_DBusConnection dbusConn = TQT_DBusConnection::addConnection(TQT_DBusConnection::SystemBus); - if (dbusConn.isConnected()) { - TQT_DBusMessage msg = TQT_DBusMessage::methodCall( - "org.freedesktop.Hal", - "/org/freedesktop/Hal/devices/computer", - "org.freedesktop.Hal.Device.CPUFreq", - "GetCPUFreqGovernor"); - TQT_DBusMessage reply = dbusConn.sendWithReply(msg); - if (reply.type() == TQT_DBusMessage::ReplyMessage && reply.count() == 1) { - return true; - } - } - } -#endif // WITH_HAL - return false; } @@ -201,24 +184,6 @@ void TDECPUDevice::setGovernor(TQString gv) { } #endif // WITH_TDEHWLIB_DAEMONS -#ifdef WITH_HAL - if ( !setGovernorDone ) { - TQT_DBusConnection dbusConn = TQT_DBusConnection::addConnection(TQT_DBusConnection::SystemBus); - if (dbusConn.isConnected()) { - TQT_DBusProxy cpuFreqControl("org.freedesktop.Hal", "/org/freedesktop/Hal/devices/computer", "org.freedesktop.Hal.Device.CPUFreq", dbusConn); - if (cpuFreqControl.canSend()) { - // set CPU governor - TQValueList params; - params << TQT_DBusData::fromString(gv.lower()); - TQT_DBusMessage reply = cpuFreqControl.sendWithReply("SetCPUFreqGovernor", params); - if (reply.type() == TQT_DBusMessage::ReplyMessage && reply.count() == 1) { - setGovernorDone = true; - } - } - } - } -#endif // WITH_HAL - // Force update of the device information object if ( setGovernorDone ) { TDEGlobal::hardwareDevices()->processModifiedCPUs(); diff --git a/tdecore/tdehw/tderootsystemdevice.cpp b/tdecore/tdehw/tderootsystemdevice.cpp index 741751581..4fe075831 100644 --- a/tdecore/tdehw/tderootsystemdevice.cpp +++ b/tdecore/tdehw/tderootsystemdevice.cpp @@ -32,13 +32,13 @@ #include "config.h" -#if defined(WITH_TDEHWLIB_DAEMONS) || defined(WITH_UPOWER) || defined(WITH_DEVKITPOWER) || defined(WITH_HAL) || defined(WITH_CONSOLEKIT) +#if defined(WITH_TDEHWLIB_DAEMONS) || defined(WITH_UPOWER) || defined(WITH_DEVKITPOWER) || defined(WITH_CONSOLEKIT) #include #include #include #include #include -#endif // defined(WITH_TDEHWLIB_DAEMONS) || defined(WITH_UPOWER) || defined(WITH_DEVKITPOWER) || defined(WITH_HAL) || defined(WITH_CONSOLEKIT) +#endif TDERootSystemDevice::TDERootSystemDevice(TDEGenericDeviceType::TDEGenericDeviceType dt, TQString dn) : TDEGenericDevice(dt, dn) { m_hibernationSpace = -1; @@ -247,32 +247,6 @@ bool TDERootSystemDevice::canSuspend() { } #endif// WITH_DEVKITPOWER -#ifdef WITH_HAL - { - TQT_DBusConnection dbusConn = TQT_DBusConnection::addConnection(TQT_DBusConnection::SystemBus); - if (dbusConn.isConnected()) { - TQT_DBusProxy halProperties("org.freedesktop.Hal", "/org/freedesktop/Hal/devices/computer", "org.freedesktop.Hal.Device", dbusConn); - if (halProperties.canSend()) { - // can suspend? - TQValueList params; - TQT_DBusMessage reply; - params.clear(); - params << TQT_DBusData::fromString("power_management.can_suspend"); - reply = halProperties.sendWithReply("GetPropertyBoolean", params); - if (reply.type() == TQT_DBusMessage::ReplyMessage && reply.count() == 1) { - return reply[0].toBool(); - } - params.clear(); - params << TQT_DBusData::fromString("power_management.can_suspend_to_ram"); - reply = halProperties.sendWithReply("GetPropertyBoolean", params); - if (reply.type() == TQT_DBusMessage::ReplyMessage && reply.count() == 1) { - return reply[0].toBool(); - } - } - } - } -#endif // WITH_HAL - #ifdef WITH_TDEHWLIB_DAEMONS { TQT_DBusConnection dbusConn = TQT_DBusConnection::addConnection(TQT_DBusConnection::SystemBus); @@ -362,32 +336,6 @@ bool TDERootSystemDevice::canHibernate() { } #endif// WITH_DEVKITPOWER -#ifdef WITH_HAL - { - TQT_DBusConnection dbusConn = TQT_DBusConnection::addConnection(TQT_DBusConnection::SystemBus); - if (dbusConn.isConnected()) { - TQT_DBusProxy halProperties("org.freedesktop.Hal", "/org/freedesktop/Hal/devices/computer", "org.freedesktop.Hal.Device", dbusConn); - if (halProperties.canSend()) { - // can hibernate? - TQValueList params; - TQT_DBusMessage reply; - params.clear(); - params << TQT_DBusData::fromString("power_management.can_hibernate"); - reply = halProperties.sendWithReply("GetPropertyBoolean", params); - if (reply.type() == TQT_DBusMessage::ReplyMessage && reply.count() == 1) { - return reply[0].toBool(); - } - params.clear(); - params << TQT_DBusData::fromString("power_management.can_suspend_to_disk"); - reply = halProperties.sendWithReply("GetPropertyBoolean", params); - if (reply.type() == TQT_DBusMessage::ReplyMessage && reply.count() == 1) { - return reply[0].toBool(); - } - } - } - } -#endif // WITH_HAL - #ifdef WITH_TDEHWLIB_DAEMONS { TQT_DBusConnection dbusConn = TQT_DBusConnection::addConnection(TQT_DBusConnection::SystemBus); @@ -444,26 +392,6 @@ bool TDERootSystemDevice::canHybridSuspend() { // No support "hybrid suspend" in org.freedesktop.UPower // No support "hybrid suspend" in org.freedesktop.DeviceKit.Power -#ifdef WITH_HAL - { - TQT_DBusConnection dbusConn = TQT_DBusConnection::addConnection(TQT_DBusConnection::SystemBus); - if (dbusConn.isConnected()) { - TQT_DBusProxy halProperties("org.freedesktop.Hal", "/org/freedesktop/Hal/devices/computer", "org.freedesktop.Hal.Device", dbusConn); - if (halProperties.canSend()) { - // can hybrid suspend? - TQValueList params; - TQT_DBusMessage reply; - params.clear(); - params << TQT_DBusData::fromString("power_management.can_suspend_hybrid"); - reply = halProperties.sendWithReply("GetPropertyBoolean", params); - if (reply.type() == TQT_DBusMessage::ReplyMessage && reply.count() == 1) { - return reply[0].toBool(); - } - } - } - } -#endif // WITH_HAL - #ifdef WITH_TDEHWLIB_DAEMONS { TQT_DBusConnection dbusConn = TQT_DBusConnection::addConnection(TQT_DBusConnection::SystemBus); @@ -794,53 +722,6 @@ bool TDERootSystemDevice::setPowerState(TDESystemPowerState::TDESystemPowerState } #endif // WITH_DEVKITPOWER -#ifdef WITH_HAL - { - // No support for "freeze" in org.freedesktop.Hal - TQT_DBusConnection dbusConn; - dbusConn = TQT_DBusConnection::addConnection(TQT_DBusConnection::SystemBus); - if ( dbusConn.isConnected() ) { - if (ps == TDESystemPowerState::Suspend) { - TQT_DBusProxy halPowerManagement( - "org.freedesktop.Hal", - "/org/freedesktop/Hal/devices/computer", - "org.freedesktop.Hal.Device.SystemPowerManagement", - dbusConn); - TQValueList params; - params << TQT_DBusData::fromInt32(0); - TQT_DBusMessage reply = halPowerManagement.sendWithReply("Suspend", params); - if (reply.type() == TQT_DBusMessage::ReplyMessage) { - return true; - } - } - else if (ps == TDESystemPowerState::Hibernate) { - TQT_DBusMessage msg = TQT_DBusMessage::methodCall( - "org.freedesktop.Hal", - "/org/freedesktop/Hal/devices/computer", - "org.freedesktop.Hal.Device.SystemPowerManagement", - "Hibernate"); - TQT_DBusMessage reply = dbusConn.sendWithReply(msg); - if (reply.type() == TQT_DBusMessage::ReplyMessage) { - return true; - } - } - else if (ps == TDESystemPowerState::HybridSuspend) { - TQT_DBusProxy halPowerManagement( - "org.freedesktop.Hal", - "/org/freedesktop/Hal/devices/computer", - "org.freedesktop.Hal.Device.SystemPowerManagement", - dbusConn); - TQValueList params; - params << TQT_DBusData::fromInt32(0); - TQT_DBusMessage reply = halPowerManagement.sendWithReply("SuspendHybrid", params); - if (reply.type() == TQT_DBusMessage::ReplyMessage) { - return true; - } - } - } - } -#endif // WITH_HAL - #ifdef WITH_TDEHWLIB_DAEMONS { TQT_DBusConnection dbusConn;