[UnindexedFileIndexer] Skip filetime checks for new files
ClosedPublic

Authored by bruns on Jun 4 2019, 2:12 PM.

Details

Summary

In case a file is not in the index, either because it is new, or as it
should not be indexed, there is no need to retrieve the timestamps from
the file (it will be different).

Diff Detail

Repository
R293 Baloo
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 12403
Build 12421: arc lint + arc unit
bruns created this revision.Jun 4 2019, 2:12 PM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptJun 4 2019, 2:12 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
bruns requested review of this revision.Jun 4 2019, 2:12 PM

I didn't know QFileInfo fetches information on demand (and caches it). That is the reason for this change, right?
I think it would be nice to elaborate on that in summary, or maybe as a brief comment in the code.

src/file/unindexedfileiterator.cpp
100

Why do we need it here?

bruns added a comment.EditedJun 4 2019, 5:43 PM

I didn't know QFileInfo fetches information on demand (and caches it). That is the reason for this change, right?
I think it would be nice to elaborate on that in summary, or maybe as a brief comment in the code.

As far as I can see, the time is actually spent in converting from statbuf to QDateTime, and the underlying data is filled in when QFileInfo is instantiated in the QDirIterator.

Although, where the time is spent is irrelevant - the timestamps are of no use when the file is new.

bruns marked an inline comment as done.Jun 4 2019, 5:43 PM
bruns added inline comments.
src/file/unindexedfileiterator.cpp
100

leftover

bruns marked an inline comment as done.Jun 4 2019, 5:46 PM
bruns updated this revision to Diff 59147.Jun 4 2019, 6:09 PM

remove leftover double timeinfo fetch
rebase

ngraham accepted this revision.Jun 10 2019, 4:47 PM
This revision is now accepted and ready to land.Jun 10 2019, 4:47 PM
This revision was automatically updated to reflect the committed changes.