From kde-core-devel Fri Jul 21 08:10:40 2006 From: Clarence Dang Date: Fri, 21 Jul 2006 08:10:40 +0000 To: kde-core-devel Subject: Re: KSelectAction Message-Id: <200607211810.42606.dang () kde ! org> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=115346897603249 On Wednesday 19 July 2006 16:11, Stephan Kulow wrote: > Am Dienstag, 18. Juli 2006 15:45 schrieb Clarence Dang: > > 3. currentText() returns "&MyString" (i.e. it adds the accelerator) > > instead of "MyString" (where "MyString" is passed to setItems()). This > > is unexpected and a subtle change from KDE 3. > > The accelerators are added most likely by kcheckaccelerator yep, KApplication -> KCheckAccelerator -> KAcceleratorManager -> KPopupAccelManager This behaviour appears to be a global KAction bug/feature, not limited to KSelectAction. text() returns what you passed to setText() or the KAction ctors, but with an extra accelerator. This is due to increased coupling of actions with the GUI: KDE 4 sets the action's text to have an accelerator: void KPopupAccelManager::setMenuEntries(const KAccelStringList &list) { QAction *maction; [...] maction->setText(list[cnt].accelerated()); KDE 3 does not act on the action's text directly: void KPopupAccelManager::setMenuEntries(const KAccelStringList &list) { QMenuItem *mitem; [...] mitem->setText(list[cnt].accelerated()); I'm not sure whether the new behaviour makes sense. Probably not though as text() and setText() should be "symmetric"?