[kdevplatform] Add ability to show ProblemsView with selected model data.
ClosedPublic

Authored by antonanikin on Aug 31 2016, 6:09 AM.

Details

Summary

This patch provide mechanism for activating (showing) selected tabs in Problems View. This is useful for plugins, which provides custom problem models and allows them to automatically (for user) shows results of the work.

Test Plan

Tested on new version of kdev-cppcheck pugin (not pushed to upstream yet):

core()->languageController()->problemModelSet()->showModel("Cppcheck");

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 6381.Aug 31 2016, 6:09 AM
antonanikin retitled this revision from to [kdevplatform] Add ability to ProblemsView for show view for selected ProblemModel .
antonanikin updated this object.
antonanikin edited the test plan for this revision. (Show Details)
antonanikin added a reviewer: KDevelop.
antonanikin set the repository for this revision to R33 KDevPlatform.
antonanikin added a subscriber: kdevelop-devel.
mwolff added a subscriber: mwolff.Sep 3 2016, 9:25 PM

If you want to access this API from elsewhere (e.g. cppcheck), please create a proper public API instead of relying on invokeMethod hacks.

antonanikin updated this revision to Diff 6416.Sep 4 2016, 10:12 AM
antonanikin edited the test plan for this revision. (Show Details)
antonanikin removed R33 KDevPlatform as the repository for this revision.

add public API

antonanikin set the repository for this revision to R33 KDevPlatform.Sep 4 2016, 10:12 AM

If you want to access this API from elsewhere (e.g. cppcheck), please create a proper public API instead of relying on invokeMethod hacks.

Ok, it's done. Because of ProblemsView class is not public, the best reasonable place which I could find for a new API is ProblemModelSet class.

antonanikin planned changes to this revision.Sep 4 2016, 1:03 PM
antonanikin updated this revision to Diff 6422.Sep 4 2016, 1:59 PM
antonanikin retitled this revision from [kdevplatform] Add ability to ProblemsView for show view for selected ProblemModel to [kdevplatform] Add ability to show ProblemsView with selected model data..

Current version also raises ProblemsView widget (and creates, if it was closed before) - now we need only 1 line of code to show ProblemModel's data for user.

mwolff accepted this revision.Sep 5 2016, 2:44 PM
mwolff added a reviewer: mwolff.

not the nicest code, but that's not your fault and I cannot come up with something better now either. so let's go for it, imo

do you have commit rights?

This revision is now accepted and ready to land.Sep 5 2016, 2:44 PM
kfunk requested changes to this revision.Sep 8 2016, 8:36 AM
kfunk added a reviewer: kfunk.
kfunk added a subscriber: kfunk.
kfunk added inline comments.
plugins/problemreporter/problemreporterplugin.cpp
156

This definitely needs to check against w being a nullptr.

plugins/problemreporter/problemsview.cpp
357

Almost copied code from ProblemsView::onModelRemoved.

Introduce a tabIndexForName(const QString&) function, called from both ProblemsView::onModelRemoved and here.

This revision now requires changes to proceed.Sep 8 2016, 8:36 AM
antonanikin updated this revision to Diff 6532.Sep 8 2016, 9:11 AM
antonanikin edited edge metadata.
antonanikin marked 2 inline comments as done.Sep 8 2016, 9:16 AM

fixes are done

plugins/problemreporter/problemreporterplugin.cpp
156

fixed. But old code seems to be correct, because we provide not-null pointer to factory and widget will be created if necessary.

antonanikin marked 2 inline comments as done.Sep 8 2016, 9:17 AM
kfunk accepted this revision.Sep 8 2016, 9:26 AM
kfunk edited edge metadata.

LGTM besides the one remaining issue.

shell/problemmodelset.cpp
80 ↗(On Diff #6532)

Use foreach (otherwise you're detaching the vector)

This revision is now accepted and ready to land.Sep 8 2016, 9:26 AM
This revision was automatically updated to reflect the committed changes.