[PATCH] Improve KShortcutDialog construction time

Andreas Hartmetz ahartmetz at gmail.com
Wed Apr 23 20:35:10 BST 2008


Am Mittwoch, 23. April 2008 16:34:35 schrieb Robert Knight:
> Hi,
>
> The attached patch series improves construction time of KShortcutEditor
> (and therefore KShortcutDialog) which currently feels quite slow in Kate
> and some other apps with a lot of shortcuts.
>
> The main problem is that when adding a new child to a QTreeWidgetItem,
> if the parent is associated with the view then the internal model will
> trigger various extra processing, particularly in the header view.
>
> This is fixed by creating the QTreeWidgetItems un-attached to the view
> and then adding them to the view's root when the widget is shown.
>
> There are also some minor optmisations:
>
> - (0008) (Use a bitflag instead of QObject::property() /
> QObject::setProperty() to store the KAction's isShortcutConfigurable
> flag.
IIRC this was done in an attempt to use QAction in KDE API, something that 
didn't work out.

> - (0009) Cache translated names for the shortcut item's display role to
> avoid creating new KLocalizedString instances every time.  I'm not sure
> why this is translated in the first place since the text for the
> translation is just "%1" which is substituted by the action's text.
>
That is just strange. I am puzzled.

The rest looks good, I think you can commit them without further ado. Watch 
out for the tabs in those files if they are still there... one patch has a 
little tab/space problem.




More information about the kde-core-devel mailing list