Multiple main window support, and action-collections
Alexander Dymo
alexander.dymo at gmail.com
Mon Jul 27 08:20:59 UTC 2009
On Monday 27 July 2009 10:51:00 David Nolden wrote:
> Am Montag 27 Juli 2009 01:29:17 schrieb Alexander Dymo:
> > I'd say we need two functions in a plugin:
> > //this would return action collection without a parent, and then will be
> > //reparented to a mainwindow by mainwindow itself
> > KActionCollection &IPlugin::guiActions()
> > QString IPlugin::xmlGuiFile()
>
> Such an API also looks like it can return the same actions all the time,
> which is not true. The actions have to be created uniquely for each
> mainwindow.
Right, so what about
KActionCollection &IPlugin::createGuiActions()
This API would also clearly divide responsibilities. Mainwindow has to create
a KXMLGUIClient for each plugin and it will do that in a private function that
would ask for xmlfile, actions and then construct a gui client. Therefore
decoupling xmlfile getter from actions getter is not a problem.
More information about the KDevelop-devel
mailing list