Fix "tools_" actions calls from KileScriptDocument

Review Request #109777 - Created March 28, 2013 and updated

Eugene Shalygin
As per discussion in the mail list.

Do not add "tools_.+" actions to the actions collection. Try to get action which is not found in the action collection from the current view
Michel Ludwig
Thanks Eugene.

I think it would even be better if "triggerAction" wouldn't have to be called at all. Could you maybe replace the call to "triggerAction" with the respective

QAction *action = m_view->action("bla");
if(action) {

in "kilescriptdocument.cpp"? (you could also introduce a method for just doing that)

I guess the same could be done for the actions that belong to Kile, even by calling the methods directy via KileInfo, and then we could remove "Manager::initScriptActions()"
altogether in "scriptmanager.cpp".
  1. Michel,
    could you share your thought on the following, please? If we are going to remove action objects then I see two possible obstacles. 1. Some of the actions are bound to Kile class methods, so instead of KileInfo we would need Kile object pointer. 2. Some of the actions are using EditorExtensions::insertTag and there is some set-up code present for XMLGUI part. Will it make sense to duplicate this code in KileScriptDocument?
  2. The main goal should be to remove the action name -> QAction* map. Maybe just see what is easier: if it's easy to use a method from KileInfo directly, then just do that; otherwise the corresponding action will have to be triggered.