Multiple main window support, and action-collections

David Nolden david.nolden.kdevelop at art-master.de
Mon Jul 27 08:56:59 UTC 2009


Am Montag 27 Juli 2009 10:45:31 schrieb David Nolden:
> Where should that returned reference point if it's supposed to be a
> completely new action-collection with each call?
>
> Also creating an action-collection is much more fuss than just getting one
> given, like in the current API.
>
> Additionally, action-collections are QObject based and thus not copyable,
> so it would have to be "KActionCollection* IPlugin::createGuiActions()" if
> anything. And any C++ programmer should know that you shouldn't deal with
> pointers if you don't have to. ;-)
Ah I just see that action-collections have explicit copy- and assign-
constructors, so that would not be the problem.

Anyway I don't see the problem with the current API. Either you do everything 
on yourself through "createGUIForMainWindow(...,...,...)", or you have a very 
convenient function where you merely add some actions to an already existing 
action-collection, through "createActionsForMainWindow(...)".

The xml-file could indeed be moved somewhere else. Actually I wouldn't care if 
it was changed to "KActionCollection IPlugin::createActions...", but it would 
lead to slightly more code on the plugin side, so it wouldn't necessarily be 
the better API.

Greetings, David





More information about the KDevelop-devel mailing list