proposed KAction/KActionCollection API changes

Richard Moore richmoore44 at gmail.com
Tue Jan 2 22:36:32 GMT 2007


On 1/2/07, Thomas Zander <zander at kde.org> wrote:
> On Tuesday 02 January 2007 22:57, Richard Moore wrote:
> Having a name/value pair in the action collection makes a lot of sense to me.
> I don't find it logical at all that I have to set a name on an object to be
> able to insert it and retrieve it from some (semi)generic container under
> that name.
> Similar to having QHash::insert() get a name as well as the value.

I see where you're coming from, but this seems different to me. This
name will also be used to identify the action in other contexts such
as DBUS access to the actions, scripting actions and of course XMLGUI
merging. Using it in all these different contexts makes it feel very
different to me than a simple name/value lookup in the action
collection.

>
>
> > > [ 4) Get rid of the ugly setObjectName() hiding in KAction ]
> >
> > Don't really understand this either - is this just a name clash?
>
> The QObject::setObjectName has basically been abused for the name of the
> action while IMO (as I said above) its not the responsibility of the object
> to remember which key is used for storage.
> Stopping that practice makes it possible to reuse the name without risking
> that users set a different object name without the actionCollection finding
> out. (which was why it was private).
> Now piece and unity has been restored.

Ok, I don't agree but I do understand.

Cheers

Rich.




More information about the kde-core-devel mailing list