[Kde-hardware-devel] Review Request: Emit battery low/critical notification when starting the session

Kai Uwe Broulik kde at privat.broulik.de
Tue Oct 30 07:26:37 UTC 2012



> On Oct. 29, 2012, 9:51 p.m., Dario Freddi wrote:
> > TBH for this change, instead of having a bool hanging around, I'd instead force calling the onBatteryPercentChanged everytime a new battery is added. This also adds a neat side-effect: not only it makes the feature available for multi-batteries, but also whenever a new battery is added to the system.

Right, I initially thought of this, and I now did a
onBatteryChargePercentChanged(b->chargePercent(), udi);
in the onDeviceAdded slot.
"Problem" is that the function does not emit a notification if the chargePercent hasn't actually changed.
Should I add a parameter then to this function?
ie. onBatteryChargePercentChanged(b->chargePercent(), udi, true); (and the true indicating "show notification no matter what"?)


- Kai Uwe


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/107117/#review21120
-----------------------------------------------------------


On Oct. 29, 2012, 4:13 p.m., Kai Uwe Broulik wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/107117/
> -----------------------------------------------------------
> 
> (Updated Oct. 29, 2012, 4:13 p.m.)
> 
> 
> Review request for Solid.
> 
> 
> Description
> -------
> 
> When starting the system while the battery is already below the warning/critical battery level threshold, there will be no notification about that.
> This patch fixes this by introducing a m_batteriesPercentNotified bool that is false on startup and if it is false, the battery low notification will be triggered if the battery is lower or becomes lower than the threshold no matter if it already has been lower.
> 
> 
> This addresses bug 298604.
>     http://bugs.kde.org/show_bug.cgi?id=298604
> 
> 
> Diffs
> -----
> 
>   powerdevil/daemon/powerdevilcore.h 7140051 
>   powerdevil/daemon/powerdevilcore.cpp 3c40780 
> 
> Diff: http://git.reviewboard.kde.org/r/107117/diff/
> 
> 
> Testing
> -------
> 
> Set my low battery level to 90% and started the system. Once the desktop was up I got the notification that my battery was low.
> I don't know if it is good to also start the suspend timer right when the desktop comes up, though.
> 
> 
> Thanks,
> 
> Kai Uwe Broulik
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-hardware-devel/attachments/20121030/3df3120e/attachment.html>


More information about the Kde-hardware-devel mailing list