diff options
author | Emanoil Kotsev <deloptes@gmail.com> | 2025-04-03 20:43:02 +0000 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-04-06 18:25:34 +0900 |
commit | 59e94436404492a16c255dbb31859715d78907fb (patch) | |
tree | 1c73b4d5ff1898a6208a464bcf90647f902a5d5e | |
parent | ac0f1e3e1f4399dde091c1e2b89a592accbb3acf (diff) | |
download | tdepowersave-59e94436.tar.gz tdepowersave-59e94436.zip |
keep track of discovered but not handled devices, so that we do not complain over and over
Signed-off-by: Emanoil Kotsev <deloptes@gmail.com>
(cherry picked from commit a0b8cfaccf4cde767ca5cc3f639cbdf7d4cf13b9)
-rw-r--r-- | src/hardware.cpp | 9 | ||||
-rw-r--r-- | src/hardware.h | 5 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/hardware.cpp b/src/hardware.cpp index 7def545..9507ae0 100644 --- a/src/hardware.cpp +++ b/src/hardware.cpp @@ -76,6 +76,7 @@ HardwareInfo::HardwareInfo() { primaryBatteriesCriticalLevel = 2; allUDIs = TQStringList(); + unknownUDIs = TQStringList(); consoleKitSession = TQString(); BatteryList.setAutoDelete( true ); // the list owns the objects @@ -128,6 +129,7 @@ bool HardwareInfo::reinitHardwareInfos () { update_info_primBattery_changed = true; allUDIs = TQStringList(); + unknownUDIs = TQStringList(); BatteryList.clear(); primaryBatteries = new BatteryCollection(BAT_PRIMARY); @@ -182,7 +184,12 @@ void HardwareInfo::processHardwareChangedEvent (TDEGenericDevice* device) { } // TODO: add needed code } else { - kdDebug() << "unmonitored device changed: " << device->uniqueID() << endl; + TQString duid = device->uniqueID(); + if (!unknownUDIs.contains(duid)) + { + kdDebug() << "unmonitored device changed: " << duid << endl; + unknownUDIs.append(duid); + } } kdDebugFuncOut(trace); diff --git a/src/hardware.h b/src/hardware.h index b46578d..4d64314 100644 --- a/src/hardware.h +++ b/src/hardware.h @@ -157,6 +157,11 @@ private: */ TQStringList allUDIs; + /*! + * This TQStringList contains the unmonitored UDIs we alread know + */ + TQStringList unknownUDIs; + //! hold information if suspend/standby/pm actions are supported and allowed /*! * This dictionary contains information about the available pm capabilities and |