From ceeaf1b65787d3ef46dd0bdbd0e6810137163fea Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Sun, 17 Dec 2023 21:10:18 +0200 Subject: QAbstractFileEngineIterator: add `bool advance()` virtual method And remove hasNext/next() methods. This remodels QAFEI to be like QFileSystemIterator. This better fits the logic in the newly added QDirListing class (which uses STL-style iterators). QFSFileEngineIterator: Initialize the internal nativeIterator in the constructor; also replace the advance() private method with an override for the advance() method inherited from the base class. QResourceFileEngineIterator: Override currentFileInfo(), with a QResouces the QFileInfo is created on demand if/when this method is called. This is the backend/private API, and QDirListing is the public API that can be used in a ranged-for to iterate over directory entries. Change-Id: I93eb7bdd64823ac01eea2dcaaa6bcc8ad868b2c4 Reviewed-by: Assam Boudjelthia Reviewed-by: Thiago Macieira Reviewed-by: Qt CI Bot --- src/corelib/io/qresource_iterator_p.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/io/qresource_iterator_p.h') diff --git a/src/corelib/io/qresource_iterator_p.h b/src/corelib/io/qresource_iterator_p.h index 8a29ef0219..bcbbc46b51 100644 --- a/src/corelib/io/qresource_iterator_p.h +++ b/src/corelib/io/qresource_iterator_p.h @@ -28,10 +28,10 @@ public: const QStringList &filterNames); ~QResourceFileEngineIterator(); - QString next() override; - bool hasNext() const override; + bool advance() override; QString currentFileName() const override; + QFileInfo currentFileInfo() const override; private: mutable QStringList entries; -- cgit v1.2.3