[kdevplatform] FilteredProblemStore scope-fix
ClosedPublic

Authored by antonanikin on Aug 25 2016, 5:27 AM.

Details

Summary

This patch fixes FilteredProblemStore - now it uses the value of current scope during problems filtration. Old version ignores scope value, which makes scope filtration GUI elements (provided by ProblemsView) completely useless.

Test Plan

Tested with standard ProblemReporterPlugin (uses own ProblemReporterModel) and with kdev-cppcheck plugin (uses standard ProblemModel). For both cases everybody works fine: grouping, scope filtration, 'show imports' filter.

Diff Detail

Repository
R33 KDevPlatform
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
antonanikin updated this revision to Diff 6250.Aug 25 2016, 5:27 AM
antonanikin retitled this revision from to fix FilteredProblemStore to account value of current scope.
antonanikin updated this object.
antonanikin edited the test plan for this revision. (Show Details)
antonanikin set the repository for this revision to R33 KDevPlatform.
antonanikin updated this object.Aug 25 2016, 5:32 AM
antonanikin added a reviewer: kfunk.
antonanikin changed the visibility from "Custom Policy" to "Public (No Login Required)".
antonanikin added a subscriber: KDevelop.
antonanikin planned changes to this revision.Aug 25 2016, 6:00 AM
This comment was removed by antonanikin.
antonanikin updated this revision to Diff 6252.Aug 25 2016, 7:10 AM
antonanikin removed R33 KDevPlatform as the repository for this revision.
antonanikin set the repository for this revision to R33 KDevPlatform.Aug 25 2016, 8:27 AM
antonanikin retitled this revision from fix FilteredProblemStore to account value of current scope to [kdevplatform] FilteredProblemStore scope-fix.Aug 27 2016, 2:55 PM
antonanikin updated this object.
antonanikin edited reviewers, added: kdevelop-devel; removed: KDevelop.
antonanikin removed a subscriber: KDevelop.
antonanikin updated this object.Sep 5 2016, 1:34 AM
antonanikin edited reviewers, added: KDevelop; removed: kdevelop-devel.
kfunk requested changes to this revision.Sep 6 2016, 2:18 PM
kfunk edited edge metadata.

Just tested. This breaks the combination of "Show Imports" + "Scope: Current Document" in the C++ problem view. The problem view no longer shows issues in the includes of the current doc.

This revision now requires changes to proceed.Sep 6 2016, 2:18 PM
antonanikin updated this revision to Diff 6529.Sep 8 2016, 8:43 AM
antonanikin edited the test plan for this revision. (Show Details)
antonanikin edited edge metadata.

New version implements 'show imports' components directly inside WatchedDocumentSet (sub)classes. This allows to use this filtration with any problem models without additional code. Currently it was implemented only for ProblemReporterModel.

For ProblemsView class also 'show imports' action fixed, which has wrong state after changing from one problem model to another and back to first. Old code don't reset action's state to correct value, which can leads to situation when model has 'show imports' property equals to false but action has true.

antonanikin updated this revision to Diff 6536.Sep 8 2016, 10:52 AM
antonanikin edited edge metadata.
antonanikin updated this revision to Diff 6537.Sep 8 2016, 11:20 AM

replace range-based for with foreach (avoid detach)

kfunk accepted this revision.Sep 8 2016, 11:46 AM
kfunk edited edge metadata.
This comment was removed by kfunk.
This revision is now accepted and ready to land.Sep 8 2016, 11:46 AM
kfunk requested changes to this revision.Sep 8 2016, 11:48 AM
kfunk edited edge metadata.

Sorry, confused reviews. I'll review this asap.

This revision now requires changes to proceed.Sep 8 2016, 11:48 AM
mwolff requested changes to this revision.Sep 9 2016, 1:26 PM
mwolff added a reviewer: mwolff.
mwolff added a subscriber: mwolff.

this is the wrong direction, we want to get rid of foreach in the long run:

https://www.kdab.com/goodbye-q_foreach/

plugins/problemreporter/problemreportermodel.cpp
15

this is wrong, docs is const, and range-based-for on a const container does not detach. please revert this stuff

shell/watcheddocumentset.cpp
198

qAsConst, keep range-based-for

kfunk added a comment.Sep 9 2016, 2:10 PM

General notice: I feel like this patch is way too invasive for this fix.

I need to review in detail, don't have time for this at the moment.

shell/watcheddocumentset.cpp
198

Quick note: We can't use that, qAsConst is Qt 5.7 material.

In D2571#50714, @kfunk wrote:

General notice: I feel like this patch is way too invasive for this fix.

Yes, current patch is not so small as first version. But I tried to fix scope and "show imports" filtrations by "right way", which allows to use such abilities with any problem models.

kfunk added a comment.Oct 12 2016, 7:42 PM

@antonanikin Any updates here?

antonanikin edited edge metadata.

@kfunk, I add some small fixes. Main change - now for Project-sets we adds project root to document set. It is useful for cppcheck plugin - it's generate some errors without location field and I set project root as location for them.

My testing don't show any problems and regressions from original code.

antonanikin updated this revision to Diff 7527.Oct 19 2016, 2:54 AM
antonanikin edited edge metadata.

update to current master

kfunk requested changes to this revision.Nov 30 2016, 8:04 PM
kfunk edited edge metadata.

Sorry for the late review.

Also needs a rebase on current master.

shell/problemstore.cpp
206

Should the getter/setter just relay to functions from d->m_documents (so you don't need to have m_showImports in ProblemStore)?

shell/problemstore.h
122

Typo

123

Make 'const'

shell/watcheddocumentset.cpp
39

Missing Q_OBJECT

70

Here and below: Introduce a flag for doUpdate & doEmit?

74

Factor out the next four lines into a separate doUpdate(MyFlag) function?

170

Initialize

shell/watcheddocumentset.h
52

Add getter, too, for symmetry

143

Style: Add newline before

This revision now requires changes to proceed.Nov 30 2016, 8:04 PM
antonanikin marked 7 inline comments as done.Dec 5 2016, 5:05 AM
antonanikin marked 7 inline comments as done.
antonanikin marked 7 inline comments as done.
antonanikin updated this revision to Diff 8760.Dec 5 2016, 5:18 AM
antonanikin edited edge metadata.
  • update to current master
  • fix inline comments
kfunk accepted this revision.Dec 16 2016, 11:45 PM
kfunk edited edge metadata.

Rest LGTM, thanks!

shell/problemmodel.h
138

Typo: 'Retrive'

153

Let's keep it virtual for now to stay consistent with the other setters? Or why did you remove it?

Note: Might want to remove the virtual from all of them. I don't see the need. They're not overloaded either, afaics

antonanikin updated this revision to Diff 9109.Dec 17 2016, 7:52 AM
antonanikin marked 2 inline comments as done.
antonanikin edited edge metadata.

inline comments fixes

shell/problemmodel.h
153

Note: Might want to remove the virtual from all of them. I don't see the need. They're not overloaded either, afaics

Done.

This revision was automatically updated to reflect the committed changes.

Causes issues in unit tests, please fix:
https://build.kde.org/view/Kdevelop/job/kdevplatform%20master%20kf5-qt5/165/PLATFORM=Linux,compiler=gcc/testReport/junit/(root)/TestSuite/test_filteredproblemstore/

QFATAL : TestFilteredProblemStore::testNoGrouping() ASSERT: "d->m_documents" in file /home/jenkins/sources/kdevplatform/kf5-qt5/shell/problemstore.cpp, line 228
FAIL! : TestFilteredProblemStore::testNoGrouping() Received a fatal error.

kfunk added a comment.EditedJan 4 2017, 7:30 PM

@antonanikin Still broken. Could you have a look please?

@kfunk Sorry for delay. Will be fixed in 1-2 days.