Ensure QFileInfo is valid for the first FilteredDirIterator entry
ClosedPublic

Authored by bruns on Apr 7 2019, 2:59 AM.

Details

Summary

FilteredDirIterator returns its own path for the first next() call. As
the fileInfo() from the underlying QDirIterator is only valid after
the QDirIterator::next() has been called, the first QFileInfo was the
default constructed one.

Initialize a proper QFileInfo() on m_firstItem, and use the QDirIterators
fileInfo() only for the subsequent ones.

Test Plan

make

Diff Detail

Repository
R293 Baloo
Branch
fileinfo
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 10548
Build 10566: arc lint + arc unit
bruns created this revision.Apr 7 2019, 2:59 AM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptApr 7 2019, 2:59 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
bruns requested review of this revision.Apr 7 2019, 2:59 AM
ngraham accepted this revision.Apr 11 2019, 6:39 PM

Very nice.

This revision is now accepted and ready to land.Apr 11 2019, 6:39 PM
This revision was automatically updated to reflect the committed changes.