Bug in KAction::initPrivate

Michael Brade brade at kde.org
Tue Sep 24 15:26:33 BST 2002


Hi,

I tried to fix the broken "To Desktop" menu in KNotes and found the cause in 
the following code snippet from kaction.cpp, line 308:

    if ( receiver && slot ) {
        d->m_connected = true;
        if ( QString(slot).find( QRegExp("\\(\\s*int\\s*\\)") ) >= 0 ) {

upto here it's fine

            QRegExp rxVal("\\{(.+)\\}");

this is what I don't understand - this regexp makes no sense to me and I have 
no idea what rxVal means.

            rxVal.setMinimal( true );
            if ( rxVal.search( name() ) >= 0 ) {

because of that strange regexp this is always -1. I don't think there are 
action names that contain "{" and "}". Not even KNotes to_desktop action ;)

                d->m_slotParam = rxVal.cap(1).toInt();
                connect( this, SIGNAL( activated( int ) ), receiver, slot );

and thus this *important* connection is never made.

            }
        }
        else
            connect( this, SIGNAL( activated() ), receiver, slot );
    }

Any ideas about this code or how to fix it? Ellis? I'd just remove the strange 
regexp and the search() call.

-- 
Michael Brade;                 KDE Developer, Student of Computer Science
  |-mail: echo brade !#|tr -d "c oh"|s\e\d 's/e/\@/2;s/$/.org/;s/bra/k/2'
  °--web: http://www.kde.org/people/michaelb.html

KDE 3: The Next Generation in Desktop Experience

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: signature
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20020924/4a0de971/attachment.sig>


More information about the kde-core-devel mailing list