Roman Jarosz kedgedev at centrum.cz
Sat Mar 1 21:12:32 GMT 2008


This patch fixes crash when applying toolbar changes in Kopete Chat View.

Kopete Chat View was crashing because ContainerNode for mainToolBar wasn't deleted but
KToolBar(mainToolBar) container was. So while the menu was regenerated the KXMLGUIBuilder
found the old ContainerNode but the ContainerNode was pointing to already deleted KToolBar.

So with this patch when we delete ContainerNodes we first save the state of container
(this is when client == state.guiClient) and after that if all clients and children are removed
we delete the ContainerNode. This is done for all KXMLGUIClients so all ContainerNodes should be deleted.

In previous implementation we could only remove the ContainerNode when client == state.guiClient and
all clients and children were removed. So if there were any non-removed clients when 
client == state.guiClient then the ContainerNode wasn't deleted.

So the crash is fixed, but there is still a bug because when the menu is regenerated some default
actions are missing. For instance the Tools menu in Kopete Chat View which contains history actions is
missing or the history actions aren't on mainToolBar.

I really don't know much about XMLGUI so can anybody look at this patch and the Kopete bug?

Roman Jarosz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fixxmlguicrash.diff
Type: application/octet-stream
Size: 3414 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080301/c6d83b6e/attachment.obj>

More information about the kde-core-devel mailing list