[PATCH] Unbreak global shortcuts configuration

David Faure faure at kde.org
Tue Feb 5 12:06:16 GMT 2008


On Wednesday 30 January 2008, Aurélien Gâteau wrote:
> KAction instances talk to KGlobalAccel singleton to make it aware of global
> shortcuts changes via KGlobalAccel::updateGlobalShortcuts() and
> KGlobalAccel::updateGlobalShortcutsAllowed() (i'm still not sure why there
> are two methods).

I just updated the README file to explain why there are two:

KGlobalAccel::updateGlobalShortcutsAllowed(true) sets the "SetPresent" flag when calling
kdedglobalaccel, which makes kdedglobalaccel actually grab the key shortcut
(so that the grab is done after the action has been defined, and only if it is enabled).
kdedglobalaccel must know about inactive global shortcuts too (e.g. those defined in
applications not running at the moment), for conflict resolution.

The code between the two method was duplicated though, so I factorized it,
see attached patch. The question is whether it makes the code easier to understand,
or worse :-) Shall I commit this refactor?

David (back to debugging why kglobalshortcuttest fails to set a global shortcut)

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kglobalaccel.diff
Type: text/x-diff
Size: 5216 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080205/fd18c41a/attachment.diff>


More information about the kde-core-devel mailing list