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

Review Request #112253 - Created Aug. 24, 2013 and submitted

Information
Frank Reininghaus
kde-baseapps
master
Reviewers
dolphin
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.
Works. No regressions found so far.

Issues

  • 2
  • 0
  • 0
  • 2
Description From Last Updated
Const Ref Emmanuel Pescosta Emmanuel Pescosta
.value("text") instead of ["text"] Emmanuel Pescosta Emmanuel Pescosta
Emmanuel Pescosta
Emmanuel Pescosta
Commit Hook
Frank Reininghaus
Review request changed

Status: Closed (submitted)

Loading...