Multiple main window support, and action-collections

David Nolden david.nolden.kdevelop at art-master.de
Sun Jul 26 19:52:50 UTC 2009


Am Sonntag 26 Juli 2009 20:26:34 schrieb Andreas Pakulat:
> One thing I'm not sure right now is wether a given KAction can be added
> to multiple clients/action collections. IIRC KActionCollection does a
> setParent (don't have the sources at hand), so we'd need need to "clone"
> actions...
No they cannot. That's exactly the problem I'm talking about. There is no way 
around creating new actions for each mainwindow as it seems. That mainwindow 
argument is not exactly needed while creating those actions, but I think it's 
consistent giving it when a method is called "createActionsForMainWindow".

So what could be realistically done is adding a function 
"createActionsForMainWindow(Sublime::MainWindow* window, QString& xmlFile, 
KActionCollection& actions)" so that the KXMLGUIClient stuff can be handled in 
background. But whether that would work for all usecases I don't know, so 
maybe it could be created as an overloaded function, where the default 
implementation of the other one does the standard stuff with the 
KXMLGUIClient.

Greetings, David





More information about the KDevelop-devel mailing list