Move "Analyze" menu items into "Code" menu
ClosedPublic

Authored by antonanikin on Mar 14 2017, 3:07 AM.

Details

Summary

In the revision D4686 Aleix Pol suggests to split source code and run-time analyzers. Runtime checkers now already moved to the "Run" menu (revison D4914).

This patch makes second step to implement "split idea" - code-checkers (Cppcheck/Clang-Tidy/Vera++/etc) now are moved to the "Code" menu (this fixes will be pushed to upstream after the revision acceptance).

The patch requires D5043 applied to kdevplatform.




Test Plan

Tested with master branch and Cppcheck/Clang-Tidy/Vera++ plugins.

Diff Detail

Repository
R32 KDevelop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
antonanikin created this revision.Mar 14 2017, 3:07 AM
antonanikin edited the summary of this revision. (Show Details)Mar 14 2017, 3:12 AM
antonanikin edited the summary of this revision. (Show Details)
kossebau added inline comments.
analyzers/cppcheck/plugin.cpp
60–69

Could this action text (and similar for the other checks) be reduced to just "Cppcheck", like done with the context actions?
That would remove all the duplicated "Analyze Current File With" which makes the menu more complex (more stuff to read).
And the same action could be reused again for both toplevel menu and context menu.

What was the motivation to have different menu texts and thus QAction objects?

78

See first comment.

app/kdevelopui.rc
111

Given the comment above. this here then would be "Analyze Current File With"

115

s.a.

antonanikin added inline comments.Mar 17 2017, 10:39 AM
analyzers/cppcheck/plugin.cpp
60–69

Could this action text (and similar for the other checks) be reduced to just "Cppcheck", like done with the context actions?

Name reduction will be great at menu but then we will have two actions with same name but with different mean (file/project analysis) in shortcuts editor :( Do you have an ideas how to fix this with "right way"?

mwolff requested changes to this revision.Mar 19 2017, 1:24 PM
mwolff added subscribers: dfaure, mwolff.

@dfaure Is there a way to give actions in the "configure shortcuts" action a different name from what is shown by menus?

analyzers/cppcheck/plugin.cpp
79

missing third argument "this"

85

missing third argument "this"

252

missing third argument "this"

This revision now requires changes to proceed.Mar 19 2017, 1:24 PM

Not right now, see kxmlgui/src/kshortcutseditoritem.cpp:54

m_actionNameInTable = i18nc([...] KLocalizedString::removeAcceleratorMarker(m_action->text()));

which is returned further down as DisplayRole for the Name column.
But you could easily add support for a custom property here ("descriptiveText") and document that, it would certainly be useful for all those actions whose text only makes sense in the context of the submenu they're in.

antonanikin edited edge metadata.
  • Rebase to master
  • Fix inline comments
antonanikin marked 5 inline comments as done.Apr 10 2017, 3:13 AM
In D5044#96609, @dfaure wrote:

Not right now, see kxmlgui/src/kshortcutseditoritem.cpp:54

m_actionNameInTable = i18nc([...] KLocalizedString::removeAcceleratorMarker(m_action->text()));

which is returned further down as DisplayRole for the Name column.
But you could easily add support for a custom property here ("descriptiveText") and document that, it would certainly be useful for all those actions whose text only makes sense in the context of the submenu they're in.

Hi, David. Thanks for your answer. Your suggestion is good, I'll try to present patch for this later.

2 all: Thanks for your review. I suggest to use this revision as base and push it to upstream. Then I will work with new patch to kdelibs to add support for custom text for shortcuts editor item and after acceptance and pushing to master we can add compile-time checks for kdelibs version to enable this functionality in cppcheck plugin. Your opinions?

This revision now requires changes to proceed.Apr 28 2017, 4:01 AM
apol accepted this revision.Apr 28 2017, 10:40 AM
This revision was automatically updated to reflect the committed changes.