[PATCH] Improve KShortcutDialog construction time
Robert Knight
robertknight at gmail.com
Wed Apr 23 15:34:35 BST 2008
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.
- (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.
Regards,
Robert.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Improve-construction-speed-of-KShortcutsEditor.-Cre.patch
Type: application/mbox
Size: 4187 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080423/df68b0e6/attachment.mbox>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Further-improve-KShortcutsEditor-construction-speed.patch
Type: application/mbox
Size: 4783 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080423/df68b0e6/attachment-0001.mbox>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-KShortcutsEditor-Short-tree-widget-items-recursive.patch
Type: application/mbox
Size: 2801 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080423/df68b0e6/attachment-0002.mbox>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-KShortcutsEditor-Use-QTreeWidget-s-built-in-sortIt.patch
Type: application/mbox
Size: 1753 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080423/df68b0e6/attachment-0003.mbox>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0008-Use-a-bit-flag-to-hold-the-isShortcutConfigurable-pr.patch
Type: application/mbox
Size: 1707 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080423/df68b0e6/attachment-0004.mbox>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0009-Minor-optimisation.-Cache-translated-names-for-shor.patch
Type: application/mbox
Size: 1502 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080423/df68b0e6/attachment-0005.mbox>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0010-Add-a-comment-to-explain-how-the-tree-view-root-is-c.patch
Type: application/mbox
Size: 1136 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080423/df68b0e6/attachment-0006.mbox>
More information about the kde-core-devel
mailing list