<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/119597/">https://git.reviewboard.kde.org/r/119597/</a>
     </td>
    </tr>
   </table>
   <br />





<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
 <tr>
  <td>

<div>Review request for Solid and Àlex Fiestas.</div>
<div>By Nikita Skovoroda.</div>


<p style="color: grey;"><i>Updated Авг. 9, 2014, 10:04 п.п.</i></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Signal fixes:
1) Use const & for passing a structure.
2) Use Qt5-styled connect() calls for nicer syntax and compile-time checks.</pre>
  </td>
 </tr>
</table>







<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
powerdevil
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This is a continuation of https://git.reviewboard.kde.org/r/119559/.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Now that all layers are aware of the actual integer brightness value and the maximum brightness value, rework «brightness up/down» actions.<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
See background explanation in previous RR.</p>
<hr style="text-rendering: inherit;margin: 0;padding: 0;white-space: normal;border: 1px solid #ddd;line-height: inherit;" />
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Implement brightnessStep logic.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Introduce brightnessStep, brightnessStepMax, brightnessStepChanged, setBrightnessStep D-Bus endpoints in org.kde.Solid.PowerManagement.Actions.BrightnessControl.<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
Introduce correspoding D-Bus endpoints in org.kde.Solid.PowerManagement.Actions.KeyboardBrightnessControl.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Use step-based logic for increase/decrease brightness actions.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This makes the increase/decrease brightness actions behave as if the brightness steps are pre-calculated.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Also, brightness percentage is now rounded everywhere (it was just cast to int without rounding before), now that the inner logic does not depend on the percentage anymore.<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
Before this patch I was not sure if this would make things look worse or not.</p>
<hr style="text-rendering: inherit;margin: 0;padding: 0;white-space: normal;border: 1px solid #ddd;line-height: inherit;" />
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">An illustraton:<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
Before: http://oserv.org/tests/kde/powerdevil/brightness_before.php<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
After: http://oserv.org/tests/kde/powerdevil/brightness_after.php, this script shares the same code for calculating steps count.</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Works for me, shortcuts now follow persistent brightness steps.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Works on acpi_video0 with 10 steps, asus::kbd_backlight with 3 steps, and intel_backlight notebook with 4000+ steps.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">The BackendInterface::calculateStepsCount() logic was separately tested for all possible max_brightness values.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Only upower backend was tested.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">HAL backend uses variable m_cachedKeyboardBrightness before it is initialized, and I am not the one who wrote it that way.</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> (updated)</h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>daemon/CMakeLists.txt <span style="color: grey">(9759ea1)</span></li>

 <li>daemon/actions/bundled/brightnesscontrol.h <span style="color: grey">(8ae3157)</span></li>

 <li>daemon/actions/bundled/brightnesscontrol.cpp <span style="color: grey">(8d06bc2)</span></li>

 <li>daemon/actions/bundled/keyboardbrightnesscontrol.h <span style="color: grey">(9f12537)</span></li>

 <li>daemon/actions/bundled/keyboardbrightnesscontrol.cpp <span style="color: grey">(075a984)</span></li>

 <li>daemon/actions/bundled/org.kde.Solid.PowerManagement.Actions.BrightnessControl.xml <span style="color: grey">(abe33c6)</span></li>

 <li>daemon/actions/bundled/org.kde.Solid.PowerManagement.Actions.KeyboardBrightnessControl.xml <span style="color: grey">(ea4a504)</span></li>

 <li>daemon/backends/hal/powerdevilhalbackend.h <span style="color: grey">(a261a65)</span></li>

 <li>daemon/backends/hal/powerdevilhalbackend.cpp <span style="color: grey">(b9ab9aa)</span></li>

 <li>daemon/backends/upower/powerdevilupowerbackend.h <span style="color: grey">(2b51f30)</span></li>

 <li>daemon/backends/upower/powerdevilupowerbackend.cpp <span style="color: grey">(92a6cdd)</span></li>

 <li>daemon/powerdevilbackendinterface.h <span style="color: grey">(d79ba46)</span></li>

 <li>daemon/powerdevilbackendinterface.cpp <span style="color: grey">(de15302)</span></li>

 <li>daemon/powerdevilbrightnesslogic.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>daemon/powerdevilbrightnesslogic.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>daemon/powerdevilkeyboardbrightnesslogic.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>daemon/powerdevilkeyboardbrightnesslogic.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>daemon/powerdevilscreenbrightnesslogic.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>daemon/powerdevilscreenbrightnesslogic.cpp <span style="color: grey">(PRE-CREATION)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/119597/diff/" style="margin-left: 3em;">View Diff</a></p>






  </td>
 </tr>
</table>




  </div>
 </body>
</html>