diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2022-02-08 23:22:23 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2022-02-10 22:47:05 +0900 |
commit | 4112c3b48633dac80afbe219fd9f4ee85b2be3d3 (patch) | |
tree | a6ef7ba4f2e1f1e76b19884ba935983f6aebd8a3 /src/hardware_battery.cpp | |
parent | 0120940b40e727c89441e9d46e3e05af8a2f0263 (diff) | |
download | tdepowersave-4112c3b48633dac80afbe219fd9f4ee85b2be3d3.tar.gz tdepowersave-4112c3b48633dac80afbe219fd9f4ee85b2be3d3.zip |
Removed HAL dependant code.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'src/hardware_battery.cpp')
-rw-r--r-- | src/hardware_battery.cpp | 50 |
1 files changed, 13 insertions, 37 deletions
diff --git a/src/hardware_battery.cpp b/src/hardware_battery.cpp index 2e60fb7..9d5c1a0 100644 --- a/src/hardware_battery.cpp +++ b/src/hardware_battery.cpp @@ -24,6 +24,10 @@ * \date 2006-2007 */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include "hardware_battery.h" // FOR REFERENCE @@ -110,20 +114,12 @@ void Battery::initDefault() { kdDebugFuncOut(trace); } -//! initialize this battery object with values from HAL +//! initialize this battery object void Battery::init() { kdDebugFuncIn(trace); - // read battery information from HAL - if (resetUdi(udi)) { - //udi is valid - recheck(); //fills all values - //ready here for now - } else { - //udi is invalid or is no battery - state=BAT_HAL_ERROR; - kdWarning() << "Warning: Battery::init cannot make use of udi " << udi << endl; - } + // read battery information + recheck(); //fills all values initialized = true; kdDebugFuncOut(trace); @@ -201,7 +197,7 @@ void Battery::recheck() { kdDebugFuncOut(trace); } -// ---> query HAL for properties SECTION : START <---- +// ---> query for properties SECTION : START <---- //! to check battery.present /*! @@ -729,11 +725,11 @@ bool Battery::checkChargingState () { return _ret; } -// ---> query HAL for properties SECTION : END <---- +// ---> query for properties SECTION : END <---- -//! to recheck a special value for a HAL event +//! to recheck a special value for an event /*! - * Check for the given property new values from HAL and set them to + * Check for the given property new values and set them to * the battery variables. * \param device TDEGenericDevice */ @@ -747,26 +743,6 @@ void Battery::updateProperty(TDEGenericDevice* device) { kdDebugFuncOut(trace); } -//! Resets the current HAL udi used by the one given -/*! -* The given TQString will be (checked and) used as new HAL udi for the battery. -* But don't forget to do a recheck of the battery afterwards. -* \param _udi TQString with the UDI to reset -* \return boolean with the result of the operation -* \retval true if reset was successfull -* \retval false if reset couldn't be applied -*/ -bool Battery::resetUdi(TQString _udi) { - kdDebugFuncIn(trace); - - // FIXME - // What does this function do outside of HAL!?!? Should it even exist any more? - bool tmp_result=true; - - kdDebugFuncOut(trace); - return tmp_result; -} - // ---> write private members SECTION : START <---- //! sets the chargelevel in percent when battery should go into state warning @@ -815,7 +791,7 @@ void Battery::setCritLevel(int _crit_level) { // ---> write private members SECTION : END <---- // ---> get private members SECTION : START <---- -//! reports the HAL udi of this battery +//! reports the udi of this battery TQString Battery::getUdi() const { return TQString(udi); } @@ -880,7 +856,7 @@ int Battery::getCurrentLevel() const { return charge_level_current; } -//! reports HAL capacity_state value +//! reports capacity_state value TQString Battery::getCapacityState() const { return TQString(capacity_state); } |