Global shortcuts are saved with their text-name and not their action-name - Bug?

Christian Esken esken at kde.org
Wed Jan 2 12:14:59 GMT 2008


Am Montag, 31. Dezember 2007 schrieb Andreas Hartmetz:
> Am Sonntag 30 Dezember 2007 20:02:50 schrieb Christian Esken:
> > Am Sonntag, 30. Dezember 2007 schrieb Andreas Pakulat:
> > > On 30.12.07 15:29:23, Andreas Hartmetz wrote:
> > > > Am Sonntag 30 Dezember 2007 13:45:18 schrieb Christian Esken:
> > > > > Hello,
> > > > >
> > > > > global shortcuts are saved with their text set with
> > > > > action->setText(), instead of their action name. This is reflected in
> > > > > ~/.kde/share/config/kglobalshortcutsrc [1]. As far as I understand
> > > > > it, this as a bug. Am I right here?

> As discussed on IRC with ervin and Chusslove, there is no easy fix. The least 
> bad thing we came up with is to postpone translation to the last possible 
> moment for all actions. That is very, very invasive though. Another option is 
> to "force" all actions to have an objectName by querying it and maybe fail in 
> some way (but only for global shortcuts) if they don't have one.
> In fact, I maybe have a best-of-both-worlds solution.: Document that an 
> objectName() is mandatory for proper global shortcuts management and use the 
> text() plus emit a warning if there is none. The objectName() can come from 
> inserting the action into a collection or from setting it manually, we don't 
> care.
> It's also the only realistic option left that I can think of.
> Not to mention the only one that won't spoil my party^Wday with work :)
> 
> For the record, another option we discussed is to assign numbers to actions in 
> their creation order in an application. That can lead to the wrong action 
> getting triggered and it is prone to break on small app code changes.
> 
> Christian: The action names will show up in the standard shortcut config 
> dialog so in any case it is a good thing to give them human-friendly names.

Sure, the name name must always be readable, but not the objectName(). So I changed it, and shortcuts work. The shortcuts are also saved, e.g. as:
kmix\x01Increase Volume - PCM, Sound Fusion CS46xx=Shift+O

But there is still an issue: The global shortcuts are *not* recognized after restarting KMix.

Also the shortcut dialog shows no shortcuts. When trying to reasign the same Shortcut to exactly the *same* action, I get a message:

   The 'Shift+O' key combination has already been allocated to the global action "Increase Volume - PCM, Sound Fusion CS46xx" in kmix.
   Do you want to reassign it from that action to the current one?

?!?

So the shortcuts are known, but not assigned to the actions. Why? What can I do here? I have already played around a lot, like also adding the actions to the global actionCollection(), but that didn't help either.

  Christian

PS: XF86AudioMute, XF86AudioLowerVolume, XF86AudioRaiseVolume don't work - for whatever reason. I alread stopped KMilo (strange ...)

> 
> > > And in the case of 2 collections getting the same action without a name
> > > they both create the same internal name.
> > >
> > > Andreas
> >
> >   Christian
> 






More information about the kde-core-devel mailing list