Review Request 124123: Feedback request. Problems ToolView GUI changes and ProblemModel refactoring.
dfighter1985 at gmail.com
Thu Jun 18 15:55:06 UTC 2015
This is an automatically generated e-mail. To reply, visit:
Review request for KDevelop.
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!
- 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)
- 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:
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:
See the included video.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the KDevelop-devel