diff options
author | João Abecasis <joao@abecasis.name> | 2009-07-16 17:12:52 (GMT) |
---|---|---|
committer | João Abecasis <joao@abecasis.name> | 2009-07-17 17:06:40 (GMT) |
commit | 74c0b4300b538b24c56abf2be2d5e09b9c59a845 (patch) | |
tree | a50f59255062bd037986784b163768a66a9472f8 /src/corelib/io | |
parent | c9579d44c6ce70066f90224c18ac964865290583 (diff) | |
download | Qt-74c0b4300b538b24c56abf2be2d5e09b9c59a845.zip Qt-74c0b4300b538b24c56abf2be2d5e09b9c59a845.tar.gz Qt-74c0b4300b538b24c56abf2be2d5e09b9c59a845.tar.bz2 |
QDirIterator: Doc fixes and whitespace cleanup
There is no QDirIterator::isValid() function.
Reviewed-by: David Boddie
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qdiriterator.cpp | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/src/corelib/io/qdiriterator.cpp b/src/corelib/io/qdiriterator.cpp index e48a1b9..ca6f3ce 100644 --- a/src/corelib/io/qdiriterator.cpp +++ b/src/corelib/io/qdiriterator.cpp @@ -230,17 +230,15 @@ bool QDirIteratorPrivate::shouldFollowDirectory(const QFileInfo &fileInfo) // If we're doing flat iteration, we're done. if (!(iteratorFlags & QDirIterator::Subdirectories)) return false; - + // Never follow non-directory entries if (!fileInfo.isDir()) return false; - // Never follow . and .. if (fileInfo.fileName() == QLatin1String(".") || fileInfo.fileName() == QLatin1String("..")) return false; - // Check symlinks if (fileInfo.isSymLink() && !(iteratorFlags & QDirIterator::FollowSymlinks)) { // Follow symlinks only if FollowSymlinks was passed @@ -250,10 +248,9 @@ bool QDirIteratorPrivate::shouldFollowDirectory(const QFileInfo &fileInfo) // Stop link loops if (visitedLinks.contains(fileInfo.canonicalFilePath())) return false; - + return true; } - /*! \internal @@ -315,7 +312,7 @@ bool QDirIteratorPrivate::matchesFilters(const QAbstractFileEngineIterator *it) return false; } #endif - + bool dotOrDotDot = (fileName == QLatin1String(".") || fileName == QLatin1String("..")); if ((filters & QDir::NoDotAndDotDot) && dotOrDotDot) return false; @@ -356,7 +353,7 @@ bool QDirIteratorPrivate::matchesFilters(const QAbstractFileEngineIterator *it) || (!fi.exists() && fi.isSymLink()))) { return false; } - + return true; } @@ -433,7 +430,7 @@ QDirIterator::QDirIterator(const QString &path, IteratorFlags flags) passed to the flags. \warning This constructor expects \c flags to be left at its default value. Use the - constructors that do not take the \a filters argument instead. + constructors that do not take the \a filters argument instead. \sa hasNext(), next(), IteratorFlags */ @@ -488,13 +485,12 @@ bool QDirIterator::hasNext() const /*! Returns the file name for the current directory entry, without the path - prepended. If the current entry is invalid (i.e., isValid() returns - false), a null QString is returned. + prepended. + + This function is convenient when iterating a single directory. When using + the QDirIterator::Subdirectories flag, you can use filePath() to get the + full path. - This function is provided for the convenience when iterating single - directories. For recursive iteration, you should call filePath() or - fileInfo() instead. - \sa filePath(), fileInfo() */ QString QDirIterator::fileName() const @@ -503,9 +499,7 @@ QString QDirIterator::fileName() const } /*! - Returns the full file path for the current directory entry. If the current - entry is invalid (i.e., isValid() returns false), a null QString is - returned. + Returns the full file path for the current directory entry. \sa fileInfo(), fileName() */ @@ -515,8 +509,7 @@ QString QDirIterator::filePath() const } /*! - Returns a QFileInfo for the current directory entry. If the current entry - is invalid (i.e., isValid() returns false), a null QFileInfo is returned. + Returns a QFileInfo for the current directory entry. \sa filePath(), fileName() */ |