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

List:       kde-core-devel
Subject:    PATCH: Re: kdelibs/kdeui
From:       Ellis Whitehead <kde () ellisw ! net>
Date:       2002-01-30 2:38:27
[Download RAW message or body]

I already committed this patch because I considered it too insignificant to 
post, but Dirk emailed me about posting patches for review, so in case he 
meant this one in particular...
This patch has KAction::~KAction() call unplugAll() to remove itself from any 
menu or toolbar it's in.
As a side note, if the menu or toolbar is destroyed before the action, then 
the action removes that widget from its plug list by catching the destroyed() 
signal.

---
I'm guessing that what you (Dirk) would have liked was a diff file to be 
posted of all the little patches put together?  I hadn't thought of that at 
the time...
With individual commits, though, it does bring up the question of just how 
insignificant does a patch need to be to forego the "post-it first" rule?  Of 
course, removing your own comment lines surely doesn't require posting 
*grin*, but there are also other things that I wouldn't have thought should 
require confirmation from the list; like bug fixes in the shortcut capture 
box or various one-liners like passing a missing argument to a QString 
construction.

Thanks,
Ellis

On Tuesday 29 January 2002 18:07, Dirk Mueller wrote:
> On Die, 29 Jan 2002, Ellis Whitehead wrote:
> > - alphabetize #includes
> > - make sure that KAction objects unplug themself from any menus or
> > toolbars they're in on destruction
>
> may I remind you to post your patches for review as well ?
>
> Thanks,
>
>
> Dirk


["kaction.cpp.diff" (text/x-diff)]

Index: kaction.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kaction.cpp,v
retrieving revision 1.227
retrieving revision 1.228
diff -u -3 -d -p -b -B -r1.227 -r1.228
--- kaction.cpp	2002/01/29 15:23:25	1.227
+++ kaction.cpp	2002/01/29 19:59:37	1.228
@@ -30,32 +30,33 @@
 
 #include "kaction.h"
 
+#include <assert.h>
+
 #include <qfontdatabase.h>
 #include <qobjectlist.h>
 #include <qptrdict.h>
-#include <qwhatsthis.h>
 #include <qtl.h>
 #include <qtooltip.h>
 #include <qvariant.h>
+#include <qwhatsthis.h>
 
-#include <kguiitem.h>
-#include <ktoolbar.h>
-#include <ktoolbarbutton.h>
-#include <kmenubar.h>
-#include <kapplication.h>
 #include <kaccel.h>
 #include <kaccelbase.h>
+#include <kapplication.h>
+#include <kcombobox.h>
 #include <kconfig.h>
-#include <kstdaccel.h>
-#include <kurl.h>
+#include <kdebug.h>
+#include <kfontcombo.h>
+#include <kglobalsettings.h>
+#include <kguiitem.h>
 #include <kiconloader.h>
-#include <kpopupmenu.h>
 #include <kmainwindow.h>
-#include <kglobalsettings.h>
-#include <kcombobox.h>
-#include <kfontcombo.h>
-#include <kdebug.h>
-#include <assert.h>
+#include <kmenubar.h>
+#include <kpopupmenu.h>
+#include <kstdaccel.h>
+#include <ktoolbar.h>
+#include <ktoolbarbutton.h>
+#include <kurl.h>
 
 static QFontDatabase *fontDataBase = 0;
 
@@ -248,6 +249,10 @@ KAction::~KAction()
     kdDebug(125) << "KAction::~KAction( this = \"" << name() << "\" )" << endl; // -- ellis
     if (d->m_kaccel)
       unplugAccel();
+
+    // Unplug from menus and toolbars.
+    unplugAll();
+
     if ( m_parentCollection )
       m_parentCollection->take( this );
 
@@ -880,7 +885,6 @@ void KAction::slotDestroyed()
   if ( sender() == d->m_kaccel )
   {
     d->m_kaccel = 0;
-    //d->m_pAccelAction = 0;
     return;
   }
 


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

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