Review Request 111830: Make determining the mime type faster for directories

Commit Hook null at kde.org
Sat Aug 24 19:26:31 BST 2013


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

(Updated Aug. 24, 2013, 6:26 p.m.)


Status
------

This change has been marked as submitted.


Review request for Dolphin and Christoph Feck.


Description
-------

Christoph noted in https://bugs.kde.org/show_bug.cgi?id=321710#c2 that "Sort by Type" sometimes does not work perfectly even in directories with a rather small number of sub-directories inside. I think that this is because we always call KFileItem::determineMimeType() before getting the type, which also tries to load the .directory files inside the directories to load the icon.

We could improve this by not calling KFileItem::determineMimeType() for directories, but assign the type based on what KFileItem::isDir() returns.

The "folder" mime type could be cached in a static QString, such that we only have to do the expensive things once for directories before the sorting can begin.

Christoph, it would be nice if you could test it!


Diffs
-----

  dolphin/src/kitemviews/kfileitemmodel.cpp 58a135c 

Diff: http://git.reviewboard.kde.org/r/111830/diff/


Testing
-------

Seems to work nicely for me.


Thanks,

Frank Reininghaus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20130824/9becaa03/attachment.htm>


More information about the kfm-devel mailing list