Removed HAL dependant code.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/153/head
Michele Calgaro 3 years ago
parent c1de664777
commit 2023cc330a
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -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} )

@ -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( )

@ -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();

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

Loading…
Cancel
Save