Energy readings seem quite unreliable - if we only have one battery
it's better just to show the actual percentage which, for whatever reason,
is usually more accurate than energy divided by energyFull.
According to the UPower specification UPS batteries do not suppliy energy values (Wh)
thus our calculation breaks when there's just an UPS and we start blinking because
we think the total percentage is zero. In case we do have batteries but no energy
just average the percentages. Still not perfect but close enough.
BUG: 348588
FIXED-IN: 5.4.0
Otherwise there will be a JS exception in the binding causing the battery percentage
to be shown on the screenlocker unconditionally leading to a "0% remaining" on a desktop PC
This can result in the "unknown" icon being shown but when an app posts an inhibition
without being found by either KService or name, that is a really naughty app.
A value of zero could either mean no battery present or it is really zero percent.
Also display "n% battery remaining" as fallback rather than an explicit "charging"
This was there to initially populate the dataengine. But since the requests are all
asynchronous the data won't be there on time anyway, so let's just wait until somebody
explicitly requests the source which was done by batterymonitor anyway resulting in two
subsequent calls potentially confusing PowerDevil and causing it to go nuts.
CCBUG: 337674
This adds a new "Inhibitions" source which has keys for each application
(amarok, vlc, ...) and inside a QVariantMap with the pretty application name
(taken from the desktop file through KService and cached localle), the
application icon and the reason for the inhibition (as provided by the app)
REVIEW: 122132
in case of several batteries; a plain "sum/count" won't do it,
especially when the batteries have different Energy. Take that into
account, report it thru the dataengine and do the math correctly
This allows the caller to suppress the OSD, for instance batterymonitor will
eventually no longer show the OSD when the user is actively dragging the slider
in the popup but still when using the mousewheel on the icon.
REVIEW: 121507
This should eventually allow us to react to hotplugging a keyboard and provide brightness
controls then. It does not yet watch for PowerDevil's availability on DBus (eg. when kded
takes a bit longer to startup), and also PowerDevil's brightness controls don't support
on-demand activation yet
REVIEW: 121365
Now that we can finally use absolute brightness values, rather than a fixed 0 - 100% range,
those values should be exposed in the dataengine. This allows us to eg. properly handle
keyboard brightness controls which usually have just a few steps
Also clean up code by moving stuff into lambdas and reworking the ugly brightness availability stuff.
REVIEW: 121355
This patch adjusts the Plasma powermanagement (and soliddevice) dataengine to use the renamed isPresent() method instead of isPlugged().
It does not rename the exposed property "Plugged in" to not break its users.
REVIEW: 118558