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










<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On June 19th, 2015, 7:01 p.m. CEST, <b>Aleix Pol Gonzalez</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/124123/diff/1/?file=380429#file380429line33" style="color: black; font-weight: bold; text-decoration: underline;">plugins/problemreporter/problemsview.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">33</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="n">class</span> <span class="nl">ProblemsView</span> <span class="p">:</span> <span class="n">public</span> <span class="n">QMainWindow</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;">Why is this a QMainWindow?</p></pre>
 </blockquote>



 <p>On June 19th, 2015, 11:49 p.m. CEST, <b>Laszlo Kis-Adam</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;">Because it has toolbar where I can add toolbar actions.
See ProblemsView::updateToolBar()</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;">Just get the icons into the toolview, this way you integrate with it just like the rest of toolviews.</p></pre>
<br />




<p>- Aleix</p>


<br />
<p>On June 18th, 2015, 5:55 p.m. CEST, Laszlo Kis-Adam 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 KDevelop.</div>
<div>By Laszlo Kis-Adam.</div>


<p style="color: grey;"><i>Updated June 18, 2015, 5:55 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kdevplatform
</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;">Hi there!
Here's the bottomline of what I've been doing:
Please DO note that this is NOT done yet, I'm only submitting it to get some feedback.
So it should NOT be merged!

(mostly)GUI changes:
====================
- Moved ProblemModel to shell
- Reworked the Problems toolview a little. Now it works like this:
-- ProblemModels are added to ProblemModelSet.
-- ProblemReporterFactory makes instances of ProblemsView.
-- ProblemsView takes the models from ProblemModelSet (also subscribes for updates about them, so if one is added or removed it can add/remove their views) and it provides a tabbed widget where the views for them can be added. It creates instances of ProblemTreeView which show the problems in ProblemModel, and adds them to the tabs. Also the tabs shows the number of problems in the ProblemModels.
-- The toolview will only add actions that are supported by the model (for example: filtering, grouping, reparsing, showing imports. Obviously reparsing doesn't make sense for runtime problem checkers)

See video:
https://www.youtube.com/watch?v=K-wcoXcz-GM


ProblemModel details:
=====================
- Broke up ProblemModel into 2 parts
-- Base ProblemModel that provides the QAbstractItemModel interface for views and can use various ProblemStores to store problems. By default it uses FilteredProblemStore.
-- ProblemReporterModel is basically the old ProblemModel that grabs problems from DUChain, it's a subclass of ProblemModel.
- ProblemStore simply stores problems as a list (well technically it stores them in a tree, but it only has 1 level, so it's a list). There's no filtering, no grouping. It's perfect for ProblemReporterModel since it does filtering itself when grabbing the problems from DUChain.
- FilteredProblemStore DOES filtering, and grouping itself. It stores problems in a tree (ProblemStoreNode subclasses). The tree structure depends on the grouping method, which is implemented with GroupingStrategy subclasses.
- Moved WatchedDocumentSet and it's subclasses from ProblemModel to ProblemStore, as it is really a detail that the model itself doesn't need, however ProblemStore which stores the problems needs it actually.
- Created a new Problem class, DetectedProblem. The intent here was to create a class with a clear interface for problems, which ProblemStore can simply store. Then I wanted to eventually replace the "old" Problem class with it. Then I realized that it's not practical because of the "show imports" feature. Which shows the problems from imported contexts. Unfortunately DUChain is the class that knows those, and it's way too much work to get it out from it. Not to mention it doesn't even make sense, since it's really something that logically belongs there. 
Therefore my current plan now is to just bring them under a common interface so that it will not matter at all. The connection to DUchain will be hidden in the implementation.
So the work that's left is creating this common interface and then making these two problem classes use it.

Using this new system is fairly straightforward.
See the test plugin that I've created to test with:
https://bitbucket.org/dfighter1985/kdev-problemtest/src

Especially widget.cpp which instantiates the model, and adds problems, or clears them based on which button is clicked.


Here's a class diagram about all this:
http://i.imgur.com/eGWR3sO.jpg</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;">See the included video.</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>interfaces/ilanguagecontroller.h <span style="color: grey">(d76284c)</span></li>

 <li>language/duchain/problem.cpp <span style="color: grey">(8cbf45b)</span></li>

 <li>plugins/problemreporter/CMakeLists.txt <span style="color: grey">(39b3643)</span></li>

 <li>plugins/problemreporter/dproblemnavigationcontext.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>plugins/problemreporter/dproblemnavigationcontext.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>plugins/problemreporter/problemhighlighter.h <span style="color: grey">(1df7a79)</span></li>

 <li>plugins/problemreporter/problemhighlighter.cpp <span style="color: grey">(b4a6ad2)</span></li>

 <li>plugins/problemreporter/problemmodel.h <span style="color: grey">(0d7d773)</span></li>

 <li>plugins/problemreporter/problemmodel.cpp <span style="color: grey">(9043a24)</span></li>

 <li>plugins/problemreporter/problemreportermodel.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>plugins/problemreporter/problemreportermodel.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>plugins/problemreporter/problemreporterplugin.h <span style="color: grey">(5afd8ad)</span></li>

 <li>plugins/problemreporter/problemreporterplugin.cpp <span style="color: grey">(5ca0c8d)</span></li>

 <li>plugins/problemreporter/problemsview.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>plugins/problemreporter/problemsview.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>plugins/problemreporter/problemtreeview.h <span style="color: grey">(b9247d4)</span></li>

 <li>plugins/problemreporter/problemtreeview.cpp <span style="color: grey">(1c42034)</span></li>

 <li>plugins/problemreporter/watcheddocumentset.h <span style="color: grey">(9dda54d)</span></li>

 <li>plugins/problemreporter/watcheddocumentset.cpp <span style="color: grey">(143ee58)</span></li>

 <li>shell/CMakeLists.txt <span style="color: grey">(cffa161)</span></li>

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

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

 <li>shell/languagecontroller.h <span style="color: grey">(b9a3d06)</span></li>

 <li>shell/languagecontroller.cpp <span style="color: grey">(d15a14b)</span></li>

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

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

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

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

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

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

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

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

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

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

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

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

</ul>

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






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







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