<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://svn.reviewboard.kde.org/r/4531/">http://svn.reviewboard.kde.org/r/4531/</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, I let this one slip a bit... coming back to it.</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://svn.reviewboard.kde.org/r/4531/diff/1/?file=30487#file30487line137" style="color: black; font-weight: bold; text-decoration: underline;">/trunk/KDE/kdelibs/kdeui/xmlgui/kxmlguiversionhandler.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

    </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; ">static void storeActionProperties( QDomDocument &doc,</pre></td>

  </tr>
 </tbody>



 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">136</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="hl">  </span><span class="k"><span class="hl">while</span></span><span class="hl"> </span><span class="p"><span class="hl">(</span></span><span class="hl"> </span><span class="o"><span class="hl">!</span></span><span class="n">actionPropElement</span><span class="p">.</span><span class="n">firstChild</span><span class="p">()<span class="hl">.</span></span><span class="n"><span class="hl">isNull</span></span><span class="p"><span class="hl">()</span></span><span class="hl"> </span><span class="p"><span class="hl">)</span></span></pre></td>
    <th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">137</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="hl">  </span><span class="n"><span class="hl">QDomNode</span></span><span class="hl"> </span><span class="n"><span class="hl">actionNode</span></span><span class="hl"> </span><span class="o"><span class="hl">=</span></span><span class="hl"> </span><span class="n">actionPropElement</span><span class="p">.</span><span class="n">firstChild</span><span class="p">()<span class="hl">;</span></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 should use firstChildElement() / nextSiblingElement() to only iterate over elements.</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://svn.reviewboard.kde.org/r/4531/diff/1/?file=30487#file30487line140" style="color: black; font-weight: bold; text-decoration: underline;">/trunk/KDE/kdelibs/kdeui/xmlgui/kxmlguiversionhandler.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

    </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; ">static void storeActionProperties( QDomDocument &doc,</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">140</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">properties</span><span class="p">.</span><span class="n">contains</span><span class="p">(</span><span class="n">actionNode</span><span class="p">.</span><span class="n">toElement</span><span class="p">().</span><span class="n">attribute</span><span class="p">(</span><span class="s">"name"</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;">Brace on the same line as the if (kdelibs/Qt coding style)</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://svn.reviewboard.kde.org/r/4531/diff/1/?file=30487#file30487line143" style="color: black; font-weight: bold; text-decoration: underline;">/trunk/KDE/kdelibs/kdeui/xmlgui/kxmlguiversionhandler.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

    </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; ">static void storeActionProperties( QDomDocument &doc,</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">143</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                    <span class="n">actionPropElement</span><span class="p">.</span><span class="n">removeChild</span><span class="p">(</span> <span class="n">actionNode</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;">Maybe add a comment about what this is all about, for future readers of the code. If I understand correctly, something like "Keep action properties from global files, unless overriden locally".</pre>
</div>
<br />



<p>- David</p>


<br />
<p>On July 6th, 2010, 8:58 p.m., Andras Mantia wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://svn.reviewboard.kde.orgrb/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 kdelibs and David Faure.</div>
<div>By Andras Mantia.</div>


<p style="color: grey;"><i>Updated 2010-07-06 20:58:39</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;">When using replaceXMLFile (but it might happen in any case when setXMLFile is called on a gui client), the code tries to copy over the local ActionProperties section to the global one, so it doesn't get lost if the global file has a higher version number. Unfortunately when doing so, it removed all ActionProperties from the global file. This way it is not possible to have global xmlui files containing ActionProperties. 
The patch fixes it, by only removing the properties of those actions that are present in the local file as well. This way user shortcut changes are preserved, even if the global file comes with different shortcuts, and global shortcuts are taken in account if they were not overwritten by the user. I suppose this was the intended behavior.</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;">I did some basic testing with KDevelop, that has this code (view is a KTextEditor view, a KXMLGuiClient):
        //in KDE >= 4.4 we can use KXMLGuiClient::replaceXMLFile to provide
        //katepart with out own restructured UI configuration
        QStringList katePartUIs = KGlobal::mainComponent().dirs()->findAllResources("data", "kdevelop/katepartui.rc");
        const QString katePartUI = katePartUIs.last();
        const QString katePartLocalUI = KStandardDirs::locateLocal("data", "kdevelop/katepartui.rc");
        view->replaceXMLFile(katePartUI, katePartLocalUI);
</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>/trunk/KDE/kdelibs/kdeui/xmlgui/kxmlguiversionhandler.cpp <span style="color: grey">(1146838)</span></li>

</ul>

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




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








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