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

List:       kde-core-devel
Subject:    Re: KSelectAction
From:       Clarence Dang <dang () kde ! org>
Date:       2006-07-21 8:10:40
Message-ID: 200607211810.42606.dang () kde ! org
[Download RAW message or body]

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"?
[prev in list] [next in list] [prev in thread] [next in thread] 

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