<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/106863/">http://git.reviewboard.kde.org/r/106863/</a>
     </td>
    </tr>
   </table>
   <br />








<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On October 24th, 2012, 11:09 a.m., <b>Oliver Henshaw</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  



<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/106863/diff/3/?file=90668#file90668line102" style="color: black; font-weight: bold; text-decoration: underline;">powerdevil/daemon/powerdevilactionpool.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 3)

    </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; ">void ActionPool::init(PowerDevil::Core *parent)</pre></td>

  </tr>
 </tbody>



 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">102</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="c1">// Is the action available and supported?</span></pre></td>
    <th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">102</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="cm">/* </span><span class="cs">NOTE</span><span class="cm">: We must not delete the action from the ActionPool if it is not supported.</span></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">103</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm">                 If we do, PowerDevilCore will try to load an action that is not there.</span></pre></td>
  </tr>

  <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">104</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm">                 Instead, always watch for isSupported() before dealing (executing, configuring) an action</span></pre></td>
  </tr>

 </tbody>





 
 

 <tbody>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">103</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">retaction</span><span class="o">-></span><span class="n">isSupported</span><span class="p">())</span> <span class="p">{</span></pre></td>
    <th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">105</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm">        if (!retaction->isSupported()) {</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">104</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">            <span class="c1">// Skip that</span></pre></td>
    <th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">106</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm">            // Skip that</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">105</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">            <span class="n">retaction</span><span class="o">-></span><span class="n">deleteLater</span><span class="p">();</span></pre></td>
    <th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">107</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm">            retaction->deleteLater();</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">106</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">            <span class="k">continue</span><span class="p">;</span></pre></td>
    <th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">108</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm">            continue;</span></pre></td>
  </tr>

 </tbody>


 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">107</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="p">}</span></pre></td>
    <th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">109</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm">        }<span class="hl">*/</span></span></pre></td>
  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Is isSupported checked everywhere it should be? Remember that this should work when DPMS is configured in but the display doesn't support DPMS (e.g. qxl or vmware displays in a VM)</pre>
 </blockquote>



 <p>On October 24th, 2012, 11:15 a.m., <b>Kai Uwe Broulik</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I ifdef'd out all the DPMS-related stuff but it would probably also be good to add a
if (action) {
  if (action->isSupported()) {
    action->onProfileLoad();
  }
} else { …
to powerdevilcore so it doesn't load an action if it is not supported.</pre>
 </blockquote>





 <p>On October 24th, 2012, 11:52 a.m., <b>Oliver Henshaw</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Guarding onProfileLoad won't be enough if/when PowerDevilDPMS action is patched to use KIdleTime timeouts rather than DPMS timeouts. Plus this complicates PowerDevilAction semantics, at least in my view.

Sorry I don't have anything more constructive to offer. It would be easier if there were a Solid::Display class to query in the profilegenerator, as in my original suggestion (or maybe the extremely new libkscreen might be more appropriate). Maybe this is more long term work though.</pre>
 </blockquote>





 <p>On October 24th, 2012, 12:11 p.m., <b>Oliver Henshaw</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Hmm, how about your addition as well as (uncompiled, untested, uncommented):

diff --git a/powerdevil/daemon/powerdevilactionpool.cpp b/powerdevil/daemon/powerdevilactionpool.cpp
index a9950f1..fae35ee 100644
--- a/powerdevil/daemon/powerdevilactionpool.cpp
+++ b/powerdevil/daemon/powerdevilactionpool.cpp
@@ -125,7 +125,7 @@ Action* ActionPool::loadAction(const QString& actionId, const KConfigGroup& grou
     if (m_actionPool.contains(actionId)) {
         Action *retaction = m_actionPool[actionId];
 
-        if (group.isValid()) {
+        if (group.isValid() && retaction->isSupported()) {
 
             if (m_activeActions.contains(actionId)) {
                 // We are reloading the action: let's unload it first then.


Which should be right as long as isSupported never changes at run-time and as long as there's not some gotcha I've not seen yet.</pre>
 </blockquote>





 <p>On October 24th, 2012, 12:15 p.m., <b>Oliver Henshaw</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Forgot to mention that that diff relies on https://git.reviewboard.kde.org/r/106692/</pre>
 </blockquote>





 <p>On October 24th, 2012, 2:35 p.m., <b>Kai Uwe Broulik</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I think isChanged _can_ change at runtime, is does a query to X11 when you call it. Don't know if _that_ can change though. Don't know if it does/can when you attach another monitor.</pre>
 </blockquote>





 <p>On October 24th, 2012, 4:35 p.m., <b>Dario Freddi</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I agree with the concerns Oliver has. I need to think a bit more over this, but indeed this has to be fixed somehow.</pre>
 </blockquote>







</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I added this to the kde 4.10 feature plan so we have some additional time to think of something :)</pre>
<br />




<p>- Kai Uwe</p>


<br />
<p>On October 15th, 2012, 4:17 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.</div>
<div>By Kai Uwe Broulik.</div>


<p style="color: grey;"><i>Updated Oct. 15, 2012, 4:17 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;">That message usually appears when starting before the Desktop is up, causing an ugly 1990's passivepopup dialog on the screen, and its contents are not really novice-user-resolvable.
On my machine it always claims "The profile Battery tried to activate DPMSControl which is a non-existent action.", which is when I compile powerdevil myself that DPMS stuff is not compiled (DPMS build requirements not met here) and so the action floats around in the config but cannot be triggered anyways. (Imho this is a really infamous message, have seen it quite often on other machines *duck*). All the other actions seem to be installed anyways, so this missing action poses no threat. I guess a kWarning would be sufficient for this.</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;">Compiles.
The previous passivepopup does not appear anymore. Did not test whether the kwarning is triggered, though. (Dunno how to get powerdevil debug console output)</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/actions/CMakeLists.txt <span style="color: grey">(db9ca47)</span></li>

 <li>powerdevil/daemon/actions/dpms/powerdevildpmsaction.cpp <span style="color: grey">(a16bf7e)</span></li>

 <li>powerdevil/daemon/powerdevilactionpool.cpp <span style="color: grey">(484c271)</span></li>

</ul>

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




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








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