D7204: Use cached version isDir()

Eike Hein noreply at phabricator.kde.org
Tue Aug 8 19:17:15 UTC 2017


hein added a comment.


  > model.isDir() does a full stat of a file.
  
  model.isDir() does indeed, but this uses model.isDir, which is a data role. The FolderView::data() implementation already uses a cache. The cache is inserted into the first time isDir() is called and evicted e.g. on item deletion. It normally shouldn't stat.
  
  This makes me wary of this patch because I don't want us to adopt an anti-pattern of caching model data as Qt Quick var copies. I expect Qt Quick to be smart enough to optimize model access.
  
  I assume you did this based on profiling? Maybe data() is broken?

REPOSITORY
  R119 Plasma Desktop

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D7204

To: davidedmundson, mart
Cc: hein, plasma-devel, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart, lukas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20170808/2e67a5a6/attachment-0001.html>


More information about the Plasma-devel mailing list