Review Request 112253: KStandardItemListWidgetInformant/KFileItemListWidgetInformant: do not call the model's data(int) method if only the "text" is needed

Frank Reininghaus frank78ac at googlemail.com
Sat Aug 24 19:54:54 BST 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/112253/
-----------------------------------------------------------

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/20130824/925b2d9b/attachment.htm>


More information about the kfm-devel mailing list