Bug in KAction::initPrivate

Michael Brade brade at kde.org
Tue Sep 24 16:25:25 BST 2002

Hi Ellis!

> This was added for the kdegames modules.  They use names like:
> 	"move to pile {1}" ... "move to pile {<x>}"
> and attach to the same slot, sparing the developer writing <x> wrapper
> slots.
Ahh, I see.

> If you don't pass a slot which takes a single int parameter, this condition
> will be skipped, and the normal connection will be made.  Otherwise, you
> can let the action know what the value of that parameter should be by
> enclosing an integer in braces.
Hmm, can't do this as the integer is dynamic. I use the following code:

    m_toDesktop = new KListAction( i18n("To Desktop"), 0, this, 
SLOT(slotToDesktop(int)), actionCollection(), "to_desktop" );

to construct a listaction, containing all available desktops. Problem: the 
connection to slotToDesktop(int) doesn't work anymore with the new code in 
KAction. Any idea how to fix it? The following line populates the menu before 
it is shown:

    connect( m_toDesktop->popupMenu(), SIGNAL(aboutToShow()), this, 
SLOT(slotUpdateDesktopActions()) );

which works fine.

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/7cb524f3/attachment.sig>

More information about the kde-core-devel mailing list