Make determining the mime type faster for directories

Review Request #111830 - Created Aug. 1, 2013 and submitted

Information
Frank Reininghaus
kde-baseapps
master
Reviewers
dolphin
cfeck
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!
Seems to work nicely for me.
Emmanuel Pescosta
Christoph Feck
Emmanuel Pescosta
Frank Reininghaus
Commit Hook
Frank Reininghaus
Review request changed

Status: Closed (submitted)

Loading...