|
|
@ -22,7 +22,7 @@
|
|
|
|
#include <tdelocale.h>
|
|
|
|
#include <tdelocale.h>
|
|
|
|
#include <kdebug.h>
|
|
|
|
#include <kdebug.h>
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __TDE_HAVE_TDEHWLIB
|
|
|
|
#ifdef HAVE_TDEWHLIB
|
|
|
|
#include <tdehardwaredevices.h>
|
|
|
|
#include <tdehardwaredevices.h>
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
@ -31,7 +31,7 @@ BatterySrc::BatterySrc(TQWidget* inParent, TQString inUDI):
|
|
|
|
mTrigger(this, 5000),
|
|
|
|
mTrigger(this, 5000),
|
|
|
|
mUDI(inUDI),
|
|
|
|
mUDI(inUDI),
|
|
|
|
mHardwareDevices(NULL){
|
|
|
|
mHardwareDevices(NULL){
|
|
|
|
#ifdef __TDE_HAVE_TDEHWLIB
|
|
|
|
#ifdef HAVE_TDEHWLIB
|
|
|
|
mHardwareDevices = TDEGlobal::hardwareDevices();
|
|
|
|
mHardwareDevices = TDEGlobal::hardwareDevices();
|
|
|
|
TDEGenericDevice* hwdevice = mHardwareDevices->findByUniqueID(inUDI);
|
|
|
|
TDEGenericDevice* hwdevice = mHardwareDevices->findByUniqueID(inUDI);
|
|
|
|
|
|
|
|
|
|
|
@ -52,7 +52,7 @@ BatterySrc::~BatterySrc(){
|
|
|
|
|
|
|
|
|
|
|
|
std::list<Source*>BatterySrc::createInstances(TQWidget* inParent){
|
|
|
|
std::list<Source*>BatterySrc::createInstances(TQWidget* inParent){
|
|
|
|
std::list<Source*> list;
|
|
|
|
std::list<Source*> list;
|
|
|
|
#ifdef __TDE_HAVE_TDEHWLIB
|
|
|
|
#ifdef HAVE_TDEHWLIB
|
|
|
|
TDEHardwareDevices* hardwareDevices = TDEGlobal::hardwareDevices();
|
|
|
|
TDEHardwareDevices* hardwareDevices = TDEGlobal::hardwareDevices();
|
|
|
|
TDEGenericHardwareList hwlist = hardwareDevices->listAllPhysicalDevices();
|
|
|
|
TDEGenericHardwareList hwlist = hardwareDevices->listAllPhysicalDevices();
|
|
|
|
TDEGenericDevice *hwdevice;
|
|
|
|
TDEGenericDevice *hwdevice;
|
|
|
@ -67,7 +67,7 @@ std::list<Source*>BatterySrc::createInstances(TQWidget* inParent){
|
|
|
|
|
|
|
|
|
|
|
|
TQString BatterySrc::fetchValue() {
|
|
|
|
TQString BatterySrc::fetchValue() {
|
|
|
|
TQString s = "n/a";
|
|
|
|
TQString s = "n/a";
|
|
|
|
#ifdef __TDE_HAVE_TDEHWLIB
|
|
|
|
#ifdef HAVE_TDEHWLIB
|
|
|
|
if (mHardwareDevices != NULL) {
|
|
|
|
if (mHardwareDevices != NULL) {
|
|
|
|
TDEGenericDevice* hwdevice = mHardwareDevices->findByUniqueID(mUDI);
|
|
|
|
TDEGenericDevice* hwdevice = mHardwareDevices->findByUniqueID(mUDI);
|
|
|
|
if (hwdevice->type() != TDEGenericDeviceType::Battery) {
|
|
|
|
if (hwdevice->type() != TDEGenericDeviceType::Battery) {
|
|
|
|