kate and kactioncollection

Benjamin Meyer ben at meyerhome.net
Mon Dec 20 19:16:51 GMT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 20 December 2004 2:00 pm, David Faure wrote:
> On Monday 20 December 2004 19:51, Benjamin Meyer wrote:
> > -  m_actionCollection = new KActionCollection( this );
> > +  m_actionCollection = new KActionCollection( (QWidget*)this );
>
> Looks wrong. Either "this" was a QWidget already and this isn't needed, or
> it's not a QWidget and your change crashes.

Ok, yah didn't think that was right :)

> >  void KateExternalToolsMenuAction::reload()
> >  {
> > -  m_actionCollection->clear ();
> > +  KAction *it = m_actionCollection->action(0);
> > +  while ( it ){
> > +    m_actionCollection->remove( it );
> > +    it = m_actionCollection->action(0);
> > +  }
>
> Well this needs more thinking IMHO. Either this code needs to be redesigned
> (not just working around the lack of clear),or clear() wasn't deprecated
> for a good reason.

The docs don't really say either way :)

> I don't know what KateExternalToolsMenuAction does, but 
> if m_actionCollection is just for bookkeeping, a QValueList<KAction *>
> would be better - and then you have clear() again.

Don't know enough of Kates internals, any Kate dev happen to know?

> [PS: I was wrong about KonqPopupMenu, that one uses the actioncollection
> correctly now, it even calls setWidget later on]

- -- 
aka icefox
Public Key: http://www.icefox.net/public_key.asc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBxyUj1rZ3LTw38vIRAvlTAJ9vcGLqk5pxUrk6MY5Q5dmIkntiMQCdEYCD
WIxOYLV1Gidi50I+naJ79CU=
=f+4e
-----END PGP SIGNATURE-----




More information about the kde-core-devel mailing list