From 4c58b5936b6d169f6745d5eea3e65744956b8d92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Thu, 16 Jul 2009 21:21:35 +0200 Subject: QDirIterator cleanup after refactoring Return value for checkAndPushDirectory is no longer used, we can just throw it out. Reviewed-by: Marius Storm-Olsen --- src/corelib/io/qdiriterator.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/corelib/io/qdiriterator.cpp b/src/corelib/io/qdiriterator.cpp index 8c7645e..2e8d9c4 100644 --- a/src/corelib/io/qdiriterator.cpp +++ b/src/corelib/io/qdiriterator.cpp @@ -109,7 +109,7 @@ public: void advance(); void pushDirectory(const QFileInfo &fileInfo); - bool checkAndPushDirectory(const QFileInfo &); + void checkAndPushDirectory(const QFileInfo &); bool matchesFilters(const QString &fileName, const QFileInfo &fi) const; QSet visitedLinks; @@ -210,35 +210,34 @@ void QDirIteratorPrivate::advance() /*! \internal */ -bool QDirIteratorPrivate::checkAndPushDirectory(const QFileInfo &fileInfo) +void QDirIteratorPrivate::checkAndPushDirectory(const QFileInfo &fileInfo) { // If we're doing flat iteration, we're done. if (!(iteratorFlags & QDirIterator::Subdirectories)) - return false; + return; // Never follow non-directory entries if (!fileInfo.isDir()) - return false; + return; // Follow symlinks only when asked if (!(iteratorFlags & QDirIterator::FollowSymlinks) && fileInfo.isSymLink()) - return false; + return; // Never follow . and .. QString fileName = fileInfo.fileName(); if (QLatin1String(".") == fileName || QLatin1String("..") == fileName) - return false; + return; // No hidden directories unless requested if (!(filters & QDir::AllDirs) && !(filters & QDir::Hidden) && fileInfo.isHidden()) - return false; + return; // Stop link loops if (visitedLinks.contains(fileInfo.canonicalFilePath())) - return false; + return; pushDirectory(fileInfo); - return true; } /*! -- cgit v0.12