Overwriting default menu entry locations (was: Re: KDE/kdelibs/kdeui/xmlgui)

Friedrich W. H. Kossebau kossebau at kde.org
Wed Jan 14 22:59:51 GMT 2009


Am Mittwoch, 14. Januar 2009, um 23:35 Uhr, schrieb David Faure:
> On Tuesday 13 January 2009, Friedrich W. H. Kossebau wrote:
> > There is no Go menu in kateui.rc. And just
> >   <Menu name="go" noMerge="1">
> >   </Menu>
> > doesn't seem to do it, creates an unnamed empty menu, as expected.
>
> Actually this is not expected (empty menus are useless).

Well, expected as by reading the code. ;) For the uselessness of empty menus, 
agreed :)

> I just fixed a bug in kdelibs trunk so that empty menus are not appended
> after all other menus anymore, can you check if this fixes your problem?

Hm, that empty menu (the Go menu from the base ) was not appended before, was 
in the place where it should be (the unnamed came from the noMerge="1"). The 
same place it is with noMerge="0", or with just left away.

No, doesn't seem to fix it. 

Because the Go menu is part of base, not additive? I guess in 
KXMLGUIClientPrivate::mergeXML() when doing the replacement it should be 
checked it the additive is empty, before calling replaceChild():
	if ( additive.attribute(attrNoMerge) == attrOne ) 
	{
		// here check if not empty
		base.parentNode().replaceChild(additive, base);
otherwise just, hm, no overview right now what to do then...

But, the addition of
<Menu name="go" noMerge="1">
</Menu>
is really a hack around the problem that one cannot redefine the location of a 
standard entry.

No idea on my part how to proceed here best... Perhaps the hack is what to do 
for now?

> David (unsure whether to backport to 4.2, this code is a bit touchy,
> even though he added unit tests for 5 different cases of xmlgui merging...)

Yes, it's really a masterpiece :)
Friedrich
-- 
Okteta - KDE 4 Hex Editor - http://utils.kde.org/projects/okteta




More information about the kde-core-devel mailing list