KAction/KActionCollection proposed changes

Hamish Rodda rodda at kde.org
Sat Oct 27 23:34:56 BST 2007


Hi,

In line with the recent discussions on KActionCollection, I present the 
attached patch for review.  It is BIC, and does the following:

1) Remove setAssociatedWidget, addAssociatedWidget, clearAssociatedWidgets, 
and associatedWidgets.

These methods made KActionCollection make changes on actions added to it, and 
several developers preferred KActionCollection to behave more like a 
container class only (no magic).

2) Replace the above with associateWidget

This method does the same thing, but on a once-off basis only.  It is a very 
straightforward port and I have almost finished most of kde.
(BTW I still plan to change the shortcut context to Qt::WidgetAndChildContext 
for 4.4, just can't get to my email at the moment to do so)

3) Change KActionCollection to return a KAction* rather than a QAction* for 
newly created actions.

This is important because calling QAction::setShortcut(s) does not set the 
default shortcut in KAction, as the methods are non-virtual.  So, most apps 
will have misbehaving shortcut config dialogs otherwise.  In the porting 
required for this I have caught many, many bugs.

4) Override setShortcuts() in KAction as well (same reason as above)


If there is consensus I'd like to commit on Monday.

BTW, I am also conducting an audit of setShortcut(), the results of which I 
will provide as a patch at a later point.

Cheers,
Hamish.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdelibs-20071028.patch
Type: text/x-diff
Size: 15703 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071028/ae0bf487/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdebase-20071028.patch
Type: text/x-diff
Size: 2957 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071028/ae0bf487/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071028/ae0bf487/attachment.sig>


More information about the kde-core-devel mailing list