Fix value returned by 'brightnessGet' DCOP call. The value is now in the range 0-100 (percentage) or -1 if brightness is not supported

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 8d7b591826)
r14.1.x
Michele Calgaro 1 year ago
parent 1ef07aa28d
commit 431f2c2113
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -2938,7 +2938,7 @@ int tdepowersave::brightnessGet() {
int retval = -1;
if (hwinfo->supportBrightness()) {
retval = (int)(((float)hwinfo->getCurrentBrightnessLevel() / (float)hwinfo->getMaxBrightnessLevel()-1) * 100.0);
retval = (int)(100.0 * hwinfo->getCurrentBrightnessLevel() / hwinfo->getMaxBrightnessLevel());
}
kdDebugFuncOut(trace);

Loading…
Cancel
Save