Diffusion Baloo 899ed35c6872

Ensure QFileInfo is valid for the first FilteredDirIterator entry

Authored by bruns on Apr 7 2019, 1:06 AM.

Description

Ensure QFileInfo is valid for the first FilteredDirIterator entry

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

Reviewers: Baloo, Frameworks, ngraham, astippich, poboiko

Reviewed By: Baloo, ngraham

Subscribers: kde-frameworks-devel

Tags: Frameworks, Baloo

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