[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: KActionCollection::remove() obsoleted by what?
From:       Waldo Bastian <bastian () kde ! org>
Date:       2003-08-30 16:40:23
[Download RAW message or body]

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

On Saturday 30 August 2003 17:45, David Faure wrote:
> On Saturday 30 August 2003 17:27, Waldo Bastian wrote:
> > KActionCollection::remove() is marked as obsolete but there is no
> > indication of what should be used instead. Just delete the action?
>
> Yes, since ~KAction says:
>
>     // If actionCollection hasn't already been destructed,
>     if ( m_parentCollection ) {
>         m_parentCollection->take( this );

Hmm.. I tried removing it from libkonq/knewmenu.cc but it crashes when I test 
my change. On the bright side, it also crashes without my change.

Cheers,
Waldo
- -- 
bastian@kde.org -=|[ SuSE, The Linux Desktop Experts ]|=- bastian@suse.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE/UNN3N4pvrENfboIRAq9FAJ4rTrpqdIVS3NysygNuqUCweYNy5wCfTWqZ
KkQM4WzrXwGgbsZDezVSgXY=
=5hXE
-----END PGP SIGNATURE-----

["cvs.diff" (text/x-diff)]

Index: knewmenu.cc
===================================================================
RCS file: /home/kde/kdebase/libkonq/knewmenu.cc,v
retrieving revision 1.86
diff -u -r1.86 knewmenu.cc
--- knewmenu.cc	30 Aug 2003 10:02:16 -0000	1.86
+++ knewmenu.cc	30 Aug 2003 16:32:34 -0000
@@ -122,10 +123,12 @@
         // We need to clean up the action collection
         // We look for our actions using the group
         QValueList<KAction*> actions = d->m_actionCollection->actions( "KNewMenu" );
-        for( QValueListIterator<KAction*> it = actions.begin(); it != actions.end(); ++it )
+        for( QValueListIterator<KAction*> it = actions.begin(); it != actions.end(); )
         {
             remove( *it );
-            d->m_actionCollection->remove( *it );
+            QValueListIterator<KAction*> deleteIt = it;
+            ++it;
+            delete *deleteIt;
         }
 
         if (!s_templatesList) { // No templates list up to now


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic