Avoid repeated Solid::Battery instantiations on charge level change
The Solid::Battery instance is only required if the updated battery is a peripheral battery. Determining if the battery belongs to a peripheral or is a power supply can be done in a significantly cheaper way using a lookup in the `m_batteriesPercent` and `m_peripheralBatteriesPercent` dictionaries. Instantiating a Solid::Battery is fairly costly, as it will typically do a synchronous UPower DBus call. (cherry picked from commit 09b0084d)
parent
4425d7ab
Please register or sign in to comment