diff options
Diffstat (limited to 'tdecore')
-rw-r--r-- | tdecore/tdehw/CMakeLists.txt | 6 | ||||
-rw-r--r-- | tdecore/tdehw/tdecpudevice.cpp | 39 | ||||
-rw-r--r-- | tdecore/tdehw/tderootsystemdevice.cpp | 123 |
3 files changed, 5 insertions, 163 deletions
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 <tqdbusdata.h> #include <tqdbusmessage.h> #include <tqdbusproxy.h> #include <tqdbusvariant.h> #include <tqdbusconnection.h> -#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<TQT_DBusData> 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 <tqdbusdata.h> #include <tqdbusmessage.h> #include <tqdbusproxy.h> #include <tqdbusvariant.h> #include <tqdbusconnection.h> -#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<TQT_DBusData> 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<TQT_DBusData> 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<TQT_DBusData> 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<TQT_DBusData> 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<TQT_DBusData> 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; |