Commit fad8ac42 authored by David Rosca's avatar David Rosca

Only send low peripheral battery notification when in discharging state

Otherwise this notification is sent when connecting devices
with "unknown" battery state (State = 0 in upower).

Differential Revision: https://phabricator.kde.org/D9575
parent 899e5f38
......@@ -514,7 +514,7 @@ bool Core::emitBatteryChargePercentNotification(int currentPercent, int previous
if (b && !b->isPowerSupply()) {
// if you leave the device out of reach or it has not been initialized yet
// it won't be "there" and report 0%, don't show anything in this case
if (!b->isPresent()) {
if (!b->isPresent() || b->chargeState() != Battery::Discharging) {
return false;
}
......
Markdown is supported
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