Review Request 115712: Do not show OSD for invalid percentage i.e -1 or 109

Martin Gräßlin mgraesslin at kde.org
Thu Feb 13 06:55:51 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/115712/#review49693
-----------------------------------------------------------



src/shell/osd.cpp
<https://git.reviewboard.kde.org/r/115712/#comment34969>

    my suggestion:
    
    percent = qBound(0, percent, 100);
    
    other suggestion if we want to keep the return I'd go for:
    static bool isValueValid(int percent)
    {
        return percent >=0 && percent <= 100;
    }
    
    and in the methods just
    if (!isValueValid(percent))
        return;


- Martin Gräßlin


On Feb. 13, 2014, 7:51 a.m., Bhushan Shah wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/115712/
> -----------------------------------------------------------
> 
> (Updated Feb. 13, 2014, 7:51 a.m.)
> 
> 
> Review request for Plasma and Martin Klapetek.
> 
> 
> Repository: plasma-framework
> 
> 
> Description
> -------
> 
> $summary
> 
> Actually this will never happen as OSD will be triggered by applications only but better to check it.
> 
> 
> Diffs
> -----
> 
>   src/shell/osd.cpp e94d225 
> 
> Diff: https://git.reviewboard.kde.org/r/115712/diff/
> 
> 
> Testing
> -------
> 
> qdbus org.kde.plasma_shell /org/kde/osdService org.kde.osdService.volumeChanged 203
> qdbus org.kde.plasma_shell /org/kde/osdService org.kde.osdService.volumeChanged -40
> 
> OSD does not show up
> 
> 
> Thanks,
> 
> Bhushan Shah
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20140213/7db1874b/attachment-0001.html>


More information about the Plasma-devel mailing list