[PATCH] bug in one of the KAction c'tors (was Re: [PATCH] Add go menu to KMail; Problem: all actions in Go menu are exec'd twice on click)

Marc Mutz Marc.Mutz at uni-bielefeld.de
Fri May 10 21:11:07 BST 2002


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

Dirk, this should probably go into 3.0.1:

On Monday 06 May 2002 18:57, Ellis Whitehead wrote:
> I can't comment on much of the code, but at least getting rid of the KAccel
> stuff is the right way to go.
<snip>

I debugged this further. It's a bug in
   KAction::KAction( const KGuiItem &, ... )
which does
   if ( receiver ) connect (...);
However, KAction::initPrivate(), called earlier in the same c'tor has already 
connected the slot ;-)

Patch against KDE_3_0_BRANCH:
Index: kaction.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kaction.cpp,v
retrieving revision 1.247.2.1
diff -u -3 -p -r1.247.2.1 kaction.cpp
- --- kaction.cpp 2002/04/10 10:48:10     1.247.2.1
+++ kaction.cpp 2002/05/10 20:05:38
@@ -206,9 +206,6 @@ KAction::KAction( const KGuiItem& item,
        initPrivate( item.text(), cut, receiver, slot );
        if( item.hasIconSet() )
                setIcon( item.iconName() );
- -
- -       if( receiver )
- -               connect( this, SIGNAL(activated()), receiver, slot );
 }

 #ifndef KDE_NO_COMPAT


Marc

- -- 
Marc Mutz <mutz at kde.org>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE83Cll3oWD+L2/6DgRAvRAAJ9+6Q1cOilk64dwpZlr6K6HlepfbgCfc3ny
tBZDszy2Jb9uEp30MozzDCI=
=m3RP
-----END PGP SIGNATURE-----





More information about the kde-core-devel mailing list