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>
pull/15/head
Michele Calgaro 8 months ago
parent 70666ec32e
commit 8d7b591826
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