diff options
author | João Abecasis <joao@abecasis.name> | 2009-07-16 19:21:35 (GMT) |
---|---|---|
committer | João Abecasis <joao@abecasis.name> | 2009-07-22 12:36:16 (GMT) |
commit | 4c58b5936b6d169f6745d5eea3e65744956b8d92 (patch) | |
tree | 3268c30d4038db4b52e6e1a68f433f7aeca6b354 /src | |
parent | a8aa2c7a7f40883680b7989465873554dfbba3d6 (diff) | |
download | Qt-4c58b5936b6d169f6745d5eea3e65744956b8d92.zip Qt-4c58b5936b6d169f6745d5eea3e65744956b8d92.tar.gz Qt-4c58b5936b6d169f6745d5eea3e65744956b8d92.tar.bz2 |
QDirIterator cleanup after refactoring
Return value for checkAndPushDirectory is no longer used, we can just
throw it out.
Reviewed-by: Marius Storm-Olsen
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/io/qdiriterator.cpp | 17 |
1 files 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<QString> 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; } /*! |