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










<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On March 15th, 2015, 10:31 a.m. UTC, <b>Dominik Haumann</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="https://git.reviewboard.kde.org/r/122910/diff/1/?file=354447#file354447line412" style="color: black; font-weight: bold; text-decoration: underline;">src/kmoretools/kmoretools.h</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

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



 
 

 <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">412</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">KMoreToolsMenuItem</span><span class="o">*</span> <span class="nf">setInitialItemText</span><span class="p">(</span><span class="k">const</span> <span class="n">QString</span><span class="o">&</span> <span class="n">itemText</span><span class="p">);</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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Qt API never returns a this pointer when settings some properties.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">While not explicitely stated here, these links may be useful:
- http://qt-project.org/wiki/API-Design-Principles
- http://kate-editor.org/2011/08/28/coding-style-and-api-design/</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">For me, this function should be:
void setInitialItemText(const QString & itemText);</p></pre>
 </blockquote>



 <p>On March 15th, 2015, 11:25 a.m. UTC, <b>Gregor Mi</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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">First of all thanks for the detailled review.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">About not returning 'this': I was thinking about the "Fluent Interface" API design principle (https://en.wikipedia.org/wiki/Fluent_interface). But I agree with you: I also did not see it in other code I read so far and I understand the arguments. Can I conclude that there is no QT equivalent and the better practice here is to write a new line for each setter statement?</p></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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Yes, don't return <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">this</code>.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">One notable exception in Qt is QString::arg, which can be chained. However, in general it's not used in Qt, because of increased complexity when debugging such code (just see section "Problems" in the wiki article you've just mentioned).</p></pre>
<br />




<p>- Kevin</p>


<br />
<p>On March 11th, 2015, 11:06 p.m. UTC, Gregor Mi wrote:</p>








<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 KDE Frameworks, Emmanuel Pescosta and Jeremy Whiting.</div>
<div>By Gregor Mi.</div>


<p style="color: grey;"><i>Updated March 11, 2015, 11:06 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
knewstuff
</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;">Moved from kservice (https://git.reviewboard.kde.org/r/122576/) to here (knewstuff).</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Example usages:
- dolphin's SpaceInfoToolsMenu: https://git.reviewboard.kde.org/r/122911/
- kate's project addin: https://git.reviewboard.kde.org/r/122374/</p></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>src/CMakeLists.txt <span style="color: grey">(3b9a403eb473e0c3760506b2757c71d603b99775)</span></li>

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

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

 <li>src/kmoretools/kmoretools_p.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/kmoretools/kmoretoolsconfigdialog_p.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/kmoretools/kmoretoolsconfigdialog_p.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/kmoretools/ui/kmoretoolsconfigwidget.ui <span style="color: grey">(PRE-CREATION)</span></li>

 <li>tests/CMakeLists.txt <span style="color: grey">(103c5fc98deaf83288b843cc66a87f2d95ad9dfb)</span></li>

 <li>tests/kmoretools/1/a.desktop <span style="color: grey">(PRE-CREATION)</span></li>

 <li>tests/kmoretools/1/b.desktop <span style="color: grey">(PRE-CREATION)</span></li>

 <li>tests/kmoretools/1/c.desktop <span style="color: grey">(PRE-CREATION)</span></li>

 <li>tests/kmoretools/2/kate.desktop <span style="color: grey">(PRE-CREATION)</span></li>

 <li>tests/kmoretools/2/kate.png <span style="color: grey">(PRE-CREATION)</span></li>

 <li>tests/kmoretools/2/mynotinstalledapp.desktop <span style="color: grey">(PRE-CREATION)</span></li>

 <li>tests/kmoretools/2/mynotinstalledapp.png <span style="color: grey">(PRE-CREATION)</span></li>

 <li>tests/kmoretools/kmoretoolstest.cpp <span style="color: grey">(PRE-CREATION)</span></li>

</ul>

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






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







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