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





 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Sorry, this doesn't look right:</pre>
 <br />





<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="http://git.reviewboard.kde.org/r/107503/diff/2/?file=96669#file96669line107" style="color: black; font-weight: bold; text-decoration: underline;">powerdevil/daemon/powerdevilprofilegenerator.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 2)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">ProfileGenerator::GeneratorResult ProfileGenerator::generateProfiles(bool toRam, bool toDisk, bool tryUpgrade)</pre></td>

  </tr>
 </tbody>




 
 



 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">107</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="k">if</span> <span class="p">(</span><span class="n">PowerDevilDPMSAction</span><span class="o">::</span><span class="n">isSupported</span><span class="p">())</span></pre></td>
  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This won't work because isSupported() is a non-static member function - it needs an object. It shouldn't compile, but it does because...</pre>
</div>
<br />

<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="http://git.reviewboard.kde.org/r/107503/diff/2/?file=96669#file96669line159" style="color: black; font-weight: bold; text-decoration: underline;">powerdevil/daemon/powerdevilprofilegenerator.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 2)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">ProfileGenerator::GeneratorResult ProfileGenerator::generateProfiles(bool toRam, bool toDisk, bool tryUpgrade)</pre></td>

  </tr>
 </tbody>




 
 



 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">159</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cp">#ifdef HAVE_DPMS</span></pre></td>
  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I don't understand why, but these ifdef's seem to evaluate to false even when dpms support is available.</pre>
</div>
<br />



 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">So powerdevilprofilegenerator generates configurations with no DPMS action unconditionally.

What's the best thing to do? Maybe move all the code that touches the DPMS extension (and so needs ifdef'ing) out of powerdevildpmsaction (into non-member functions, maybe in a private include file) leaving only the core action logic. And then the profile generator (and handlebuttoneventsconfig, but that's just cosmetic) could use that. I made a start on a half-baked patch series to do the code movement, but it's currently on the shelf as it raised some questions abut xlib error handling and it didn't seem necessary given the approach in review #107257. I hadn't planned to revisit it until after 4.10 branched.

A slightly quicker fix is just to move the isSupported code to a non-member function. You'd still need to make sure that the x error handling is sane in the function and in the action though (I suspect that using kxerrorhandler from kdelibs/kdeui/util is the best way forward).

The most-short-term option, and the one I favour, is to revert this and try the ifdef'd powerdevildpmsaction stub (from review #106863) instead.


P.S. Are you able to test the DPMS code paths in a virtual machine? Why don't you have DPMS support available anyway?
</pre>

<p>- Oliver</p>


<br />
<p>On November 28th, 2012, 2:14 p.m., Kai Uwe Broulik wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Solid and Oliver Henshaw.</div>
<div>By Kai Uwe Broulik.</div>


<p style="color: grey;"><i>Updated Nov. 28, 2012, 2:14 p.m.</i></p>






<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;">I found out that the Powerdevilprofilegenerator which is fired on first start of a KDE session which generates the profile and sets the defaults adds the DPMS action no matter if it is compiled or supported. That patch makes it only add it when it is compiled (HAVE_DPMS) and the action returns isSupported(). This will silence the most prominend warning about missing DPMS and having something in the config file which doesn't work is not good.
Combined with the patch by Oliver Henshaw this will make PowerDevil not stick in your face on startup anymore (except for that Battery Low stuff I added :D which I am thinking of a fix)</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;">Deleted my powermanagementrc, Tested *without* DPMS, works flawlessly. Cannot test with since I do not have DPMS support.</pre>
  </td>
 </tr>
</table>




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

 <li>powerdevil/daemon/powerdevilprofilegenerator.cpp <span style="color: grey">(4cdbe11)</span></li>

</ul>

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




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








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