Review Request 130123: Fix the skip disabled backlight device
Lamarque Souza
lamarque at kde.org
Tue May 9 12:40:45 UTC 2017
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/130123/#review103208
-----------------------------------------------------------
daemon/backends/upower/backlighthelper.h (line 58)
<https://git.reviewboard.kde.org/r/130123/#comment68681>
static bool isRawBacklightEnabled(const QString &interface);
daemon/backends/upower/backlighthelper.cpp (line 68)
<https://git.reviewboard.kde.org/r/130123/#comment68673>
You can pass the file path directly to the constructor:
QFile file(BACKLIGHT_SYSFS_PATH + interface + "/device/enabled");
daemon/backends/upower/backlighthelper.cpp (line 69)
<https://git.reviewboard.kde.org/r/130123/#comment68675>
Remove this line and declare this variable when it is really needed below.
daemon/backends/upower/backlighthelper.cpp (line 70)
<https://git.reviewboard.kde.org/r/130123/#comment68677>
This variable is not needed.
daemon/backends/upower/backlighthelper.cpp (line 72)
<https://git.reviewboard.kde.org/r/130123/#comment68674>
This line can be removed after the change above.
daemon/backends/upower/backlighthelper.cpp (line 74)
<https://git.reviewboard.kde.org/r/130123/#comment68678>
return false;
daemon/backends/upower/backlighthelper.cpp (line 77)
<https://git.reviewboard.kde.org/r/130123/#comment68676>
QByteBarry buffer = file.readLine().trimmed();
daemon/backends/upower/backlighthelper.cpp (line 79)
<https://git.reviewboard.kde.org/r/130123/#comment68679>
return true.
QFile's destructor already closes the file.
daemon/backends/upower/backlighthelper.cpp (line 83)
<https://git.reviewboard.kde.org/r/130123/#comment68680>
return false.
daemon/backends/upower/backlighthelper.cpp (line 110)
<https://git.reviewboard.kde.org/r/130123/#comment68682>
Code style: add a { at the and of this line and a } after the line below.
- Lamarque Souza
On May 9, 2017, 6:49 a.m., AceLan Kao wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/130123/
> -----------------------------------------------------------
>
> (Updated May 9, 2017, 6:49 a.m.)
>
>
> Review request for Solid.
>
>
> Repository: powerdevil
>
>
> Description
> -------
>
> Only raw backlight interface have the "enabled" file under "device"
> directory.
> So the commit
> 5c0d35c skip the disabled backlight device
> affects all types of backlight interfaces is wrong, it will drop out all
> other type of backlight interfaces except raw tyep backlight.
>
> To fix this, we just need to check the enabled file for raw backlight
> interfaces only.
>
> Signed-off-by: AceLan Kao <acelan at acelan.idv.tw>
>
>
> Diffs
> -----
>
> daemon/backends/upower/backlighthelper.h 1382dd09938840371dbf34312fe2e8093abfbe10
> daemon/backends/upower/backlighthelper.cpp e0eb6c461a7aac50533e833953977d46a7c8e4f3
>
> Diff: https://git.reviewboard.kde.org/r/130123/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> AceLan Kao
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-hardware-devel/attachments/20170509/815ab1aa/attachment.html>
More information about the Kde-hardware-devel
mailing list