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.
Details
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.
If you want to access this API from elsewhere (e.g. cppcheck), please create a proper public API instead of relying on invokeMethod hacks.
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.
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.
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?
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. |
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. |
LGTM besides the one remaining issue.
shell/problemmodelset.cpp | ||
---|---|---|
80 | Use foreach (otherwise you're detaching the vector) |