Diffusion Baloo cdcad139a529

[UnindexedFileIterator] Delay mimetype determination until it is needed

Authored by bruns on Jun 4 2019, 6:01 PM.

Description

[UnindexedFileIterator] Delay mimetype determination until it is needed

Summary:
The mimetype is only required if all the other checks pass, i.e. when
the file has been modified or added.

It is beneficial to swap the order of timestamp and mimetype checks, as
the mimetype determination is much more expensive than the timestamp
retrieval, and the mimetype filter will only reject files occasionally
while the mtime filter will reject files most of the times.

Skip the mimetype determination for directories which would return
wrong results anyway, either "application/octet-stream" or even
"text/plain" for a directory named "test.log".

Reviewers: Baloo, ngraham, astippich, poboiko

Reviewed By: Baloo, ngraham, poboiko

Subscribers: kde-frameworks-devel

Tags: Frameworks, Baloo

Differential Revision: https://phabricator.kde.org/D21578