Different "strategy" for global shortcuts

David Faure faure at kde.org
Tue Jun 12 18:33:48 UTC 2012


On Tuesday 29 May 2012 10:18:34 Mark wrote:
> > >  (KConfig? KGlobal? K..?)
> > 
> > Not those, for sure. KConfig doesn't know QtWidgets, KGlobal is on the way
> > out.
> > This should be a new namespace or class, for modularity. Something like
> > KGlobalShortcutRegister or what not. Or maybe new code in the existing
> > KGlobalAccel.
> > Problems to solve will include storing data for each action (I'd recommend
> > dynamic properties for this too), and ensuring that changing the default
> > shortcut as a user, updates the global shortcut.
> 
> Note: this is why i added the above defaultShortcutsRestored signal to
> allow a signal/slot connection when the shortcuts are restored and thus
> update that in the registered shortcuts.

But this is only for "restoring to defaults". I'm also talking about the case 
of changing the shortcut [for a global action] to something custom.
With normal QActions, everything happens "inside" the QAction code.
For actions with a global shortcuts (i.e. QActions registered in a 
KGlobalShortcutRegister class), the register has to somehow be told. You're 
right, a signal would do, but then it should cover both cases, and be rather
  void shortcutChanged(...);

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Sponsored by Nokia to work on KDE, incl. KDE Frameworks 5



More information about the Kde-frameworks-devel mailing list