[PATCH] Unbreak global shortcuts configuration

Aurélien Gâteau aurelien.gateau at free.fr
Sun Jan 27 20:39:15 GMT 2008


Hello,

I announced last week I was working on the global shortcuts kcm and intended
to post a patch this monday. Obviously I am a bit late :-), but here are
the patches.

The patches are against kdelibs and kdebase. I use git-svn for kdelibs and
svn+quilt for kdebase right now, so the patches are formatted a bit
differently, sorry about that.

# 0_dont_loose_shortcut_on_close.diff
This is the patch I posted to fix shortcuts disappearing when you close the
kcm. It's not elegant, since it involves intentionally leaking the KAction
instances so that their destructor do not delete the shortcuts. I include
it nevertheless because the other patches are based on it. As I said in my
previous message, it could be done in a more elegant way by adding a flag
to KAction to disable shortcut deletion when it is deleted. Will probably
do it.

# 1_{kdelibs,kdebase}_show_empty_actions.diff
This patchset brings the empty actions (like KWin actions) back.
To do so, I had to rework the way the kcm initialize itself: it used to ask
KdedGlobalAccel for all available shortcuts, then for each shortcut get the
action. Obviously this implementation couldn't get actions without
shortcuts.
My implementation ask KdedGlobalAccel for the list of components, then for
the list of actions for each component. To do so it adds two methods to
KdedGlobalAccel: allComponents() and allActionsForComponent(). I also had
to remove all the "remove empty shortcuts" code from KdedGlobalAccel.

# 2_{kdelibs,kdebase}_default_shortcuts.diff
Previous patchset makes it possible to define shortcuts for all actions, but
when you define a custom shortcut, close the kcm and open it again, your
custom shortcut will appear as the default one.
This second patchset makes KdedGlobalAccel aware of the concept of default
and active shortcuts. It adds a new method: defaultShortcut(), which is
used by the kcm to initialize the KAction correctly.

I guess people will object against applying the patches until #0 is fixed,
but I would like to have feedback about the others nevertheless.

Aurélien
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0_dont_loose_shortcuts_on_close.diff
Type: text/x-patch
Size: 1440 bytes
Desc: 
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080127/de53de65/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1_kdebase_show_empty_actions.diff
Type: text/x-patch
Size: 3559 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080127/de53de65/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1_kdelibs_show_empty_actions.diff
Type: text/x-patch
Size: 3450 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080127/de53de65/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2_kdebase_default_shortcuts.diff
Type: text/x-patch
Size: 1960 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080127/de53de65/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2_kdelibs_default_shortcuts.diff
Type: text/x-patch
Size: 5853 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080127/de53de65/attachment-0004.bin>


More information about the kde-core-devel mailing list