[PATCH] Unbreak global shortcuts configuration

Aurélien Gâteau aurelien.gateau at free.fr
Tue Feb 5 13:28:28 GMT 2008

David Faure a écrit :
> 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.

Oh, I see. It makes sense indeed.

> 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?

Looks good to me. You may want to replace calls to 
action->globalShortcut() with activeShortcut in your helper function.


More information about the kde-core-devel mailing list