Simon Hausmann wrote: > > On Mon, 29 May 2000, Kurt Granroth wrote: > ::snip:: > > My guess is that the actions are somehow getting the wrong instance to > > use for loading the icons. Now Simon fixed up the instance related > > stuff in kaction and I thought that fixed everything but I was wrong. > > The reason for this is what we discussed on irc recently :-) > > The action object knows about the correct instance (thanks to the parent > KActionCollection) . I implemented this at the time KAction loaded the > icon itself by calling KIconLoader and then passing the pixmap over to > KToolBar. That fix however became useless when KAction started passing the > icon name (instead of the pixmap) to KToolBar, which however is the > correct thing from KToolBar's point of view :) . The wrong thing is that > KToolBar (in particular KToolBarButton) does not know about the correct > KInstance. So when embedding it uses the global instance, which is wrong > when embedding ;-) > > As we already discussed on IRC I believe the right solution is to let > KToolBarButton know about the right KInstance. This sounds a bit like > overhead (each toolbarbutton holding a pointer to the right KInstance), > but I see now other way. If we just let KToolBar know about a KInstance, > then this will break as soon as two components with different instances > insert buttons into the same toolbar. Hmmm... I don't like it (adding 4/8 bytes to each button :), but you are right - it seems to be the only reliable solution... -- Werner Trobin - wtrobin@mandrakesoft.com