Skip to content
Commit 09b0084d authored by Stefan Brüns's avatar Stefan Brüns
Browse files

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.
parent d88ed825
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment