D15140: Fix random order in "Analyze Current File/Project With" menus

Friedrich W. H. Kossebau noreply at phabricator.kde.org
Tue Sep 11 14:26:39 BST 2018

kossebau added a comment.

  In D15140#323991 <https://phabricator.kde.org/D15140#323991>, @antonanikin wrote:
  > Hi, Friedrich.
  > Thanks for your review. I think about ordering problem and found another interesting solution. We can use `KXMLGUIClient::plugActionList()` <https://api.kde.org/frameworks/kxmlgui/html/classKXMLGUIClient.html#a6bb023822002f53370e7c2858d3042ff> method to solve our case. We can implement common base class, for example `ICodeAnalyzerPlugin`, with appropriate methods which return file/project analyze actions and use them to (re)build sorted menus and plug them into our main menubar. Such approach can be also used for another plugins, like Heaptrack/Valgrind (run-time checkers/analyzers).
  > What are you think about such way?
  Actions added with `KXMLGUIClient::plugActionList()` are not properly known to KXMLGUI, which e.g. means they cannot be added to the toolbar persistently or (not sure) be edited in the key shortcut dialog. Not sure if those loses are worth the gain. 
  Right now I would favour your initial proposal.
  And for the future I would see us extending KXMLGUI to support some flag for action groups, which define some order (or perhaps even a callback id, so we can inject custom sorting algorithms). 
  Having a random/undefined order in the menu on adding other XmlGuiClients is a generic challenge, so other users of KXmlGui might find the option to define orders good to have as well.

  R32 KDevelop


To: antonanikin, #kdevelop
Cc: kossebau, kdevelop-devel, antismap, iodelay, vbspam, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20180911/060d17d6/attachment.html>

More information about the KDevelop-devel mailing list