diff options
author | Michele Calgaro <[email protected]> | 2023-08-23 13:11:57 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2023-08-23 13:11:57 +0900 |
commit | 8d7b59182699760823b0997412039ee3cbdb346f (patch) | |
tree | 61892f9a50573117378a4985c59c75d0d0308e19 /src/tdepowersave.cpp | |
parent | 70666ec32ec02fa33b8773ec2d19d4eebb03d7f7 (diff) | |
download | tdepowersave-8d7b59182699760823b0997412039ee3cbdb346f.tar.gz tdepowersave-8d7b59182699760823b0997412039ee3cbdb346f.zip |
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 <[email protected]>
Diffstat (limited to 'src/tdepowersave.cpp')
-rw-r--r-- | src/tdepowersave.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tdepowersave.cpp b/src/tdepowersave.cpp index 4db6039..2cbc837 100644 --- a/src/tdepowersave.cpp +++ b/src/tdepowersave.cpp @@ -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); |