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

Frank Reininghaus frank78ac at googlemail.com
Thu Aug 1 07:44:53 BST 2013


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

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 1b4911d 

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/20130801/7c49bd1a/attachment.htm>


More information about the kfm-devel mailing list