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/plugins/platforms/android/androidcontentfileengine.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/plugins/platforms/android/androidcontentfileengine.h') diff --git a/src/plugins/platforms/android/androidcontentfileengine.h b/src/plugins/platforms/android/androidcontentfileengine.h index dd7985db80..ee43185eab 100644 --- a/src/plugins/platforms/android/androidcontentfileengine.h +++ b/src/plugins/platforms/android/androidcontentfileengine.h @@ -55,8 +55,9 @@ public: AndroidContentFileEngineIterator(const QString &path, QDir::Filters filters, const QStringList &filterNames); ~AndroidContentFileEngineIterator(); - QString next() override; - bool hasNext() const override; + + bool advance() override; + QString currentFileName() const override; QString currentFilePath() const override; private: -- cgit v1.2.3