<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/109986/">http://git.reviewboard.kde.org/r/109986/</a>
     </td>
    </tr>
   </table>
   <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/109986/diff/1/?file=138478#file138478line269" style="color: black; font-weight: bold; text-decoration: underline;">plugins/documentview/kdevdocumentview.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; ">void KDevDocumentView::activated( KDevelop::IDocument* document )</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">269</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">label</span> <span class="o">=</span> <span class="n">ps</span><span class="p">.</span><span class="n">join</span><span class="p">(</span> <span class="n">QDir</span><span class="o">::</span><span class="n">separator</span><span class="p">()</span> <span class="p">)</span> <span class="o">+</span> <span class="n">QDir</span><span class="o">::</span><span class="n">separator</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 and the above three lines could be done more safely with QFileInfo(label).path() (and also shorter). Even though creating a QFileInfo incurs an overhead, this shouldn't be that much of an issue since one rarely opens new documents within milliseconds.</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/109986/diff/1/?file=138478#file138478line271" style="color: black; font-weight: bold; text-decoration: underline;">plugins/documentview/kdevdocumentview.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; ">void KDevDocumentView::activated( KDevelop::IDocument* document )</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">271</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">KDevCategoryItem</span> <span class="o">*</span><span class="n">mimeItem</span> <span class="o">=</span> <span class="n">m_documentModel</span><span class="o">-></span><span class="n">category</span><span class="p">(</span> <span class="n">label</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;">Just minor, but the variable name does not fit well anymore</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/109986/diff/1/?file=138478#file138478line311" style="color: black; font-weight: bold; text-decoration: underline;">plugins/documentview/kdevdocumentview.cpp</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">311</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">QString</span> <span class="n">label</span> <span class="o">=</span> <span class="n">item</span><span class="o">-></span><span class="n">toolTip</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;">I think it would be nicer to have a dedicated getter for the label. If in the future we decide to include more data in the tooltip this will suddenly break.</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/109986/diff/1/?file=138478#file138478line313" style="color: black; font-weight: bold; text-decoration: underline;">plugins/documentview/kdevdocumentview.cpp</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">313</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">foreach</span> <span class="p">(</span> <span class="k">const</span> <span class="n">QString</span> <span class="o">&</span><span class="n">projectPath</span><span class="p">,</span> <span class="n">m_projectFolders</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;">You could store the projects instead of the project folders and the urls in the categories instead of just strings.

This will improve the type-safety, allow to use this stuff easily with remote-projects and let you use IProject::relativeUrl() to get a project-relative path.</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/109986/diff/1/?file=138478#file138478line320" style="color: black; font-weight: bold; text-decoration: underline;">plugins/documentview/kdevdocumentview.cpp</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">320</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">label</span> <span class="o">=</span> <span class="n">ps</span><span class="p">.</span><span class="n">join</span><span class="p">(</span> <span class="n">QDir</span><span class="o">::</span><span class="n">separator</span><span class="p">()</span> <span class="p">)</span> <span class="o">+</span> <span class="n">QDir</span><span class="o">::</span><span class="n">separator</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 is the same 3 lines as above in opened(). If you change it there change it here too and if not, at least factor out the duplicated lines into a local static function.</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/109986/diff/1/?file=138478#file138478line334" style="color: black; font-weight: bold; text-decoration: underline;">plugins/documentview/kdevdocumentview.cpp</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">334</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">QList</span><span class="o"><</span><span class="n">KDevelop</span><span class="o">::</span><span class="n">IProject</span><span class="o">*></span> <span class="n">projects</span> <span class="o">=</span> <span class="n">KDevelop</span><span class="o">::</span><span class="n">ICore</span><span class="o">::</span><span class="n">self</span><span class="p">()</span><span class="o">-></span><span class="n">projectController</span><span class="p">()</span><span class="o">-></span><span class="n">projects</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;">Storing the projects instead of just their folders would also allow you to avoid the extra clearing/iteration here and just use assignment.</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/109986/diff/1/?file=138480#file138480line41" style="color: black; font-weight: bold; text-decoration: underline;">plugins/documentview/kdevdocumentviewdelegate.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; ">KDevDocumentViewDelegate::~KDevDocumentViewDelegate()</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">41</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="k">const</span> <span class="kt">bool</span> <span class="n">useExpandIndicator</span> <span class="o">=</span> <span class="nb">true</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;">Whats the reason for this?</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/109986/diff/1/?file=138480#file138480line77" style="color: black; font-weight: bold; text-decoration: underline;">plugins/documentview/kdevdocumentviewdelegate.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; ">void KDevDocumentViewDelegate::paint( QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const</pre></td>

  </tr>
 </tbody>



 
 

 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">73</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="n">m_view</span><span class="o">-></span><span class="n">style</span><span class="p">()</span> <span class="o">-></span><span class="n">drawItemText</span><span class="p">(</span> <span class="n">painter</span><span class="p">,</span> <span class="n">textrect</span><span class="p">,</span> <span class="n">Qt</span><span class="o">::</span><span class="n">AlignCenter</span><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">76</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="n">m_view</span><span class="o">-></span><span class="n">style</span><span class="p">()</span> <span class="o">-></span><span class="n">drawItemText</span><span class="p">(</span> <span class="n">painter</span><span class="p">,</span> <span class="n">textrect</span><span class="p">,</span> <span class="n">Qt</span><span class="o">::</span><span class="n">Align<span class="hl">Left</span></span><span class="hl"> </span><span class="o"><span class="hl">|</span></span><span class="hl"> </span><span class="n"><span class="hl">Qt</span></span><span class="o"><span class="hl">::</span></span><span class="n"><span class="hl">AlignV</span>Center</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;">Hmm, this seems to still elide the text - according to your screenshot. So I guess the elidedText function call was never needed?</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;">In general I think the change is great.</pre>

<p>- Andreas</p>


<br />
<p>On April 12th, 2013, 11:50 p.m. UTC, Sebastian Kügler wrote:</p>








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

<div>Review request for KDevelop.</div>
<div>By Sebastian Kügler.</div>


<p style="color: grey;"><i>Updated April 12, 2013, 11:50 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;">This patch changes the categorization in KDevelop's Documents sidebar to categorizing by path, not by mimetype anymore.

The problems with sorting by mimetypes are:

- files that are related to each other are often far away in the UI
- there are often files with the same name right underneath each other, making picking the right one almost impossible

With this patch, the sidebar is organized per path, in alphabetical order. This makes the location of a file in the UI more predictable, groups file in a more meaningful way.


I've asked a few people on IRC about this, nobody was particularly attached to the current design, so I changed the current one, instead of adding a new plugin. (It makes sense to me personally as well, I don't see how categorization by mimetype there is useful, but my use case is rather limited).

Please give it a try, tell me what you think of it. You can find the code in the sebas/sidebar branch in kdevplatform.</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;">Tested with my actual projects, behaviour feels much better, I now (kind of ;)) enjoy the sidebar, rather than outright hating it. :-)

I didn't notice any particular misbehaviour or breakage, performance also doesn't seem to be a problem.</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>plugins/documentview/kdevdocumentviewdelegate.cpp <span style="color: grey">(b172ac0d5b2c1a60cbd45d26e30b72ef725d8678)</span></li>

 <li>plugins/documentview/kdevdocumentview.desktop.cmake <span style="color: grey">(a89e79e18a9b79becd669813ead2d2e31f588a4d)</span></li>

 <li>plugins/documentview/kdevdocumentview.cpp <span style="color: grey">(b8c4a02ad31fb8aaf29691d7d7d991c4b699360e)</span></li>

 <li>plugins/documentview/kdevdocumentview.h <span style="color: grey">(e237f1050aee6c4ef383c809d929b524f94cb938)</span></li>

 <li>plugins/documentview/kdevdocumentmodel.cpp <span style="color: grey">(b411a815680ee92d8eaf81b19266f24c6b4a4f13)</span></li>

 <li>plugins/documentview/kdevdocumentmodel.h <span style="color: grey">(05cff452c403156cd53e9caaf029d6bbcd394862)</span></li>

</ul>

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



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

<ul>

 <li><a href="http://git.reviewboard.kde.org/media/uploaded/files/2013/04/12/kdevelop-sidebar-original.png">original sidebar</a></li>

 <li><a href="http://git.reviewboard.kde.org/media/uploaded/files/2013/04/12/kdevelop-sidebar-new.png">new sidebar</a></li>

</ul>





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








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