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








<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On January 10th, 2012, 1:58 p.m., <b>Milian Wolff</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/103613/diff/2/?file=46366#file46366line62" style="color: black; font-weight: bold; text-decoration: underline;">languages/cpp/codegen/generateaccessorsdialog.h</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="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">private slots:</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">62</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">  <span class="kt">void</span> <span class="n">on_btnSelectAll_clicked</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;">on_foo_clicked() is not very Qt-like, call it:

selectAllClicked()

same for the functions below</pre>
 </blockquote>



 <p>On January 10th, 2012, 2:55 p.m., <b>Jonas Jacobi</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;">the naming is for the qt auto signal slot connections, so i don't have to do them manually</pre>
 </blockquote>





 <p>On January 10th, 2012, 4:20 p.m., <b>Milian Wolff</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;">qt auto signal slot connections? what is that? can you please show me a link? I still don't like the names though.</pre>
 </blockquote>





 <p>On January 11th, 2012, 8:54 a.m., <b>Jonas Jacobi</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;">http://developer.qt.nokia.com/doc/qt-4.8/designer-using-a-ui-file.html#automatic-connections</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;">nice, something new to learn every day :)

yet still, this is so far nowhere used in kdevelop/kdevplatform and as such I'd refrain from using it. It might be a bit faster to write down, but the manual way allows for much nicer slot names and is more explicit and probably easier for others (like me :)) to comprehend</pre>
<br />

<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On January 10th, 2012, 1:58 p.m., <b>Milian Wolff</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/103613/diff/2/?file=46367#file46367line60" style="color: black; font-weight: bold; text-decoration: underline;">languages/cpp/codegen/generateaccessorsdialog.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="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">bool GenerateAccessorsDialog::init( CppClassType::Ptr classType, KDevelop::TopDUContext* topContext )</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">60</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">  <span class="n">txtStripPrefixes</span><span class="o">-></span><span class="n">setText</span><span class="p">(</span> <span class="n">mAccessorSettings</span><span class="o">-></span><span class="n">removePrefixes</span><span class="p">().</span><span class="n">join</span><span class="p">(</span> <span class="s">", "</span> <span class="p">)</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;">please change the ui names, don't put the type (txt, chk, rdo, ...) into the name

stripPrefixes alone is fine enough</pre>
 </blockquote>



 <p>On January 11th, 2012, 8:54 a.m., <b>Jonas Jacobi</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;">What is the reasoning behind this?
If you read unknown code (without having to take a look at the ui file), you get a (simple) idea of the ui, without actually looking at it.
The semantics of for example setChecked() depends on the widget being a checkbox or radiobutton and you know what happens, just by reading the name.
But, if KDevelops policy is to not have such prefixes, i'll remove them, of course.</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;">indeed you are right - even I did this - sorry!

I just want to ask: what is rdo? This might need a better name (at least I don't get it - i.e. it doesn't seem to be intuitive)

My personal naming scheme is more like this:

fooBarLabel (for QLabel)
fooBarCombo (for QComboBox)
asdfLayout (for any layout)
...

this way, when writing the code you just have to remember the name, not the type. I like this better, but you can also use your own style here, just a suggestion.</pre>
<br />

<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On January 10th, 2012, 1:58 p.m., <b>Milian Wolff</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/103613/diff/2/?file=46367#file46367line369" style="color: black; font-weight: bold; text-decoration: underline;">languages/cpp/codegen/generateaccessorsdialog.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="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">bool GenerateAccessorsDialog::init( CppClassType::Ptr classType, KDevelop::TopDUContext* topContext )</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">369</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">  <span class="n">QStack</span><span class="o"><</span><span class="n">BaseClassInstance</span><span class="o">></span> <span class="n">baseClasses</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;">this looks wrong, why don't you just use ClassDeclaration::isPublicBaseClass ?

also, this should be done somewhere else already - just grep the code. for signal/slot support e.g. we also need to know whether we have a QObject or not. So please share code, i.e. use stuff from cppduchain helpers or push existing code there and then reuse it</pre>
 </blockquote>



 <p>On January 10th, 2012, 2:55 p.m., <b>Jonas Jacobi</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 don't use isPublicBaseClass, because i don't have the actual QObject type, i search the hierarchy only by name.
If you could tell me, how i can get the type, or at least, where to look for it, i'll gladly change the code.</pre>
 </blockquote>





 <p>On January 10th, 2012, 4:20 p.m., <b>Milian Wolff</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;">see e.g. ExpressionVisitor::qObjectPtrType() - please move this code and the related other method(s) to cppduchain/typeutils for reuse</pre>
 </blockquote>





 <p>On January 11th, 2012, 8:54 a.m., <b>Jonas Jacobi</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;">Ah i didn't know i could just create a new instance of a class type, i just assumed object identity is required.
So then i don't move code to typeutils, but just create the qobject type and use isPublicBaseClass.</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;">no, please move the code to create the qobject type to typeutils and create a helper there - this is much cleaner. People should just be able to call isQObject(someClassType) without having to first create the QObject type manually.</pre>
<br />




<p>- Milian</p>


<br />
<p>On January 10th, 2012, 12:23 p.m., Jonas Jacobi 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 KDevelop.</div>
<div>By Jonas Jacobi.</div>


<p style="color: grey;"><i>Updated Jan. 10, 2012, 12:23 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;">Generate accessors (getters/setters) for C++.

This patch adds the possibility to create accessor methods for class member variables via the gui.
The dialog offers the following features:
- shows all members of a selected class in a tree view (with getters/setters as children), if it was opened on a class member that one is pre-selected
- only shows setters if applicable (non-const member)
- accessor method definitions can be created inline or separate (in the fitting source file, if applicable)
- configurable automatic creation of method names with manual override for each accessor method
- access policy (visibility) setting global and individualy for each accessor method
- configurable default setter parameter name with manual override for each setter (void setFoo(int myParamterName))
- selectable getter return type (e.g. Type, Type&, const Type& for a member of type Type)
- create setters as slots for QObject subclasses

The code is in a usable state and i would like to get some feedback on the dialog, especially on usability improvements.

Regards,
Jonas</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>languages/cpp/CMakeLists.txt <span style="color: grey">(a1fb97c)</span></li>

 <li>languages/cpp/codegen/generateaccessorsdialog.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>languages/cpp/codegen/generateaccessorsdialog.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>languages/cpp/codegen/generateaccessorsmodel.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>languages/cpp/codegen/generateaccessorsmodel.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>languages/cpp/codegen/simplerefactoring.h <span style="color: grey">(b2187c3)</span></li>

 <li>languages/cpp/codegen/simplerefactoring.cpp <span style="color: grey">(fd62ccf)</span></li>

 <li>languages/cpp/codegen/ui/cppgenerateaccessors.ui <span style="color: grey">(PRE-CREATION)</span></li>

 <li>languages/cpp/cppduchain/sourcemanipulation.h <span style="color: grey">(6f8a79b)</span></li>

 <li>languages/cpp/cppduchain/sourcemanipulation.cpp <span style="color: grey">(3f40eb2)</span></li>

 <li>languages/cpp/tests/CMakeLists.txt <span style="color: grey">(40d07b0)</span></li>

 <li>pics/mini/private_slot.png <span style="color: grey">(PRE-CREATION)</span></li>

 <li>pics/mini/protected_slot.png <span style="color: grey">(PRE-CREATION)</span></li>

 <li>pics/mini/public_slot.png <span style="color: grey">(PRE-CREATION)</span></li>

</ul>

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



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Screenshots </h1>

<div>

 <a href="http://git.reviewboard.kde.org/r/103613/s/413/"><img src="http://git.reviewboard.kde.org/media/uploaded/images/2012/01/10/create_setter_example1_400x100.png" style="border: 1px black solid;" alt="" /></a>

 <a href="http://git.reviewboard.kde.org/r/103613/s/412/"><img src="http://git.reviewboard.kde.org/media/uploaded/images/2012/01/10/create_getter_example1_400x100.png" style="border: 1px black solid;" alt="" /></a>

</div>


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








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