DefineGroups getting lost after switching KParts

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Tue Jun 29 17:29:00 BST 2010


Thomas Friedrichsmeier schrieb:
> - Problem description -
> In RKWard we have a host of different KParts, many of which contain child 
> clients. The main window's ui.rc sets up some <DefineGroup>s, and some of the 
> KParts make use of these groups. Up until KDE 4.3.4, this worked fine, actions 
> appeared where they were supposed to. It still works fine in KDE 4.4 as long as 
> there has only been exactly one call to 
> KParts::MainWindow::createGUI(KParts::Part*), i.e. there has not been any 
> switching between active parts. As soon as a part is switched, the actions are 
> placed as though the <DefineGroups> did not exist.

It turns out, the problem was due to the fact that several of ui.rc 
files used the same "client name" as specified using <[kpart]gui 
name="...">. When removing a KXMLGUIClient the factory will purge all 
merge-points that were set by a client of the same client name. 
Obviously that will lead to problems when clients share the same name.

I still don't understand, why this problem was affected by the patch in 
my original post, nor the problem did not show up in KDE 4.3.x, but then 
that does not matter any longer.

But to sum up, in case anybody runs into a similar problem, and finds 
this post:
- Yes, that name-attribute really is important.
- Yes, you should make sure, each ui.rc uses a unique name, even if the 
rc-files are not meant to be used as part of a library.
- No, there is no warning, if you add several clients with the same 
name, but you're asking for trouble, when you do.

Regards
Thomas




More information about the kde-core-devel mailing list