Skip to content

Commit

Permalink
fix: compilation on Qt 6.8.1
Browse files Browse the repository at this point in the history
Fix beginEntryList.
  • Loading branch information
asterwyx authored and justforlxz committed Dec 3, 2024
1 parent ca52ff7 commit e1f300f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
14 changes: 12 additions & 2 deletions src/dci/private/ddcifileengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ DDciFileEngineIterator::DDciFileEngineIterator(QDir::Filters filters, const QStr

}

#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 1)
DDciFileEngineIterator::DDciFileEngineIterator(QDirListing::IteratorFlags filters, const QStringList &nameFilters)
: QAbstractFileEngineIterator(nullptr, filters, nameFilters)
{

}
#endif

#if QT_VERSION < QT_VERSION_CHECK(6, 8, 0)
QString DDciFileEngineIterator::next()
{
Expand Down Expand Up @@ -564,14 +572,16 @@ QDateTime DDciFileEngine::fileTime(QAbstractFileEngine::FileTime time) const
return QFileInfo(dciFilePath).fileTime(static_cast<QFile::FileTime>(time));
}
#endif

#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 1)
QAbstractFileEngine::IteratorUniquePtr DDciFileEngine::beginEntryList(const QString &path, QDirListing::IteratorFlags filters, const QStringList &filterNames)
#elif QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
QAbstractFileEngine::IteratorUniquePtr DDciFileEngine::beginEntryList(const QString &path, QDir::Filters filters, const QStringList &filterNames)
#else
DDciFileEngine::Iterator *DDciFileEngine::beginEntryList(QDir::Filters filters, const QStringList &filterNames)
#endif
{
#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
Q_UNUSED(path);
return QAbstractFileEngine::IteratorUniquePtr(new DDciFileEngineIterator(filters, filterNames));
#else
return new DDciFileEngineIterator(filters, filterNames);
Expand Down
7 changes: 5 additions & 2 deletions src/dci/private/ddcifileengine_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class DDciFileEngineIterator : public QAbstractFileEngineIterator
QString next() override;
bool hasNext() const override;
#else
DDciFileEngineIterator(QDirListing::IteratorFlags filters, const QStringList &nameFilters);
bool advance() override;
#endif

Expand Down Expand Up @@ -110,8 +111,10 @@ class DDciFileEngine : public QAbstractFileEngine
#endif

typedef DDciFileEngineIterator Iterator;

#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 1)
IteratorUniquePtr beginEntryList(const QString &path, QDirListing::IteratorFlags filters, const QStringList &filterNames) override;
IteratorUniquePtr endEntryList() override;
#elif QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
IteratorUniquePtr beginEntryList(const QString &path, QDir::Filters filters, const QStringList &filterNames) override;
IteratorUniquePtr endEntryList() override;
#else
Expand Down
5 changes: 3 additions & 2 deletions src/filesystem/dcapfsfileengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,9 @@ QStringList DCapFSFileEngine::entryList(QDir::Filters filters, const QStringList
return {};
return QFSFileEngine::entryList(filters, filterNames);
}

#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 1)
QAbstractFileEngine::IteratorUniquePtr DCapFSFileEngine::beginEntryList(const QString &path, QDirListing::IteratorFlags filters, const QStringList &filterNames)
#elif QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
QAbstractFileEngine::IteratorUniquePtr DCapFSFileEngine::beginEntryList(const QString &path, QDir::Filters filters, const QStringList &filterNames)
#else
QAbstractFileEngine::Iterator *DCapFSFileEngine::beginEntryList(QDir::Filters filters, const QStringList &filterNames)
Expand Down
4 changes: 3 additions & 1 deletion src/filesystem/private/dcapfsfileengine_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ class DCapFSFileEngine : public QFSFileEngine, public DObject
bool cloneTo(QAbstractFileEngine *target) override;
bool setSize(qint64 size) override;
QStringList entryList(QDir::Filters filters, const QStringList &filterNames) const override;
#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 1)
IteratorUniquePtr beginEntryList(const QString &path, QDirListing::IteratorFlags filters, const QStringList &filterNames) override;
#elif QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
IteratorUniquePtr beginEntryList(const QString &path, QDir::Filters filters, const QStringList &filterNames) override;
#else
Iterator *beginEntryList(QDir::Filters filters, const QStringList &filterNames) override;
Expand Down

0 comments on commit e1f300f

Please sign in to comment.