Review Request 112253: KStandardItemListWidgetInformant/KFileItemListWidgetInformant: do not call the model's data(int) method if only the "text" is needed
Commit Hook
null at kde.org
Wed Sep 4 20:42:56 BST 2013
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/112253/
-----------------------------------------------------------
(Updated Sept. 4, 2013, 7:42 p.m.)
Status
------
This change has been marked as submitted.
Review request for Dolphin.
Description
-------
As I said on the mailing list some time ago, I think we can reduce the memory usage considerably by lazy-loading most of the data for each item. However, this only makes sense if we reduce the number of calls to the model's data() method, which constructs the full QHash containing all data, as much as possible.
Currently, KStandardItemListWidgetInformant calls the data() method for every single item, but the full data is actually only needed for the size calculation in Compact View. In Details View, no data are needed at all to determine the size required for the item, and in Icons View, only the name is needed.
This patch makes it possible for subclasses of KStandardItemListWidgetInformant to provide an alternative way to obtain the "text", to prevent calling the data() method of the model.
Diffs
-----
dolphin/src/kitemviews/kfileitemlistwidget.h 24c6778
dolphin/src/kitemviews/kfileitemlistwidget.cpp 3a77241
dolphin/src/kitemviews/kstandarditemlistwidget.h 4bf6116
dolphin/src/kitemviews/kstandarditemlistwidget.cpp 2a89004
Diff: http://git.reviewboard.kde.org/r/112253/diff/
Testing
-------
Works. No regressions found so far.
Thanks,
Frank Reininghaus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20130904/d36352af/attachment.htm>
More information about the kfm-devel
mailing list