[PATCH] KXMLGUIFactory/KActionCollection - Fix resetting shortcuts to default value
robertknight at gmail.com
Tue Jul 22 04:30:09 BST 2008
I found a bug that can occur when resetting the shortcut for an action
from a custom shortcut back to its default value in multi-document
applications like Kate and Konsole.
When editing shortcuts, the action collection for the current document
is added to the KShortcutsDialog. After the user accepts the dialog,
the updated shortcuts are automatically applied to the current document
actions but the actions for the other documents need to be updated as
well. Kate's approach, which I take it is correct, is to iterate
through each document's KXMLGUIClient and call reloadXML() to refresh
The problem is that KXMLGUIFactory only sets the shortcut of an existing
action if there is a "shortcut" attribute defined for it in the
ActionProperties section of the XML document. When resetting a shortcut
to the default value, this attribute is deleted from the document and so
the action's shortcut is not reset when reloadXML is called. The result
is that the shortcuts for actions that are not in the active document or
window are not updated until the application is restarted.
The attached patch adds support for a "default" value for the 'shortcut'
attribute which causes the KAction's ActiveShortcut to be set to the
value of the DefaultShortcut.
Please review. Incidentally - do we have a review board for kdelibs
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 3652 bytes
Desc: not available
More information about the kde-core-devel