summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Abecasis <joao@abecasis.name>2009-07-17 10:23:57 (GMT)
committerJoão Abecasis <joao@abecasis.name>2009-07-22 12:36:17 (GMT)
commit919e6f1ba2a6441c554bdb1b2c7d8ca78e33c557 (patch)
tree39e86758dfc64ac80f472bce26b5f66e0c131648
parent3da795b77f3bb0752eb14057086241f25293e26d (diff)
downloadQt-919e6f1ba2a6441c554bdb1b2c7d8ca78e33c557.zip
Qt-919e6f1ba2a6441c554bdb1b2c7d8ca78e33c557.tar.gz
Qt-919e6f1ba2a6441c554bdb1b2c7d8ca78e33c557.tar.bz2
QDirIterator: fail early, fail often
If nothing else changes, there's no point to keep trying. Let a broken QDirIterator be broken. Reviewed-by: Marius Storm-Olsen
-rw-r--r--src/corelib/io/qdiriterator.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/io/qdiriterator.cpp b/src/corelib/io/qdiriterator.cpp
index 09001c6..ea54941 100644
--- a/src/corelib/io/qdiriterator.cpp
+++ b/src/corelib/io/qdiriterator.cpp
@@ -131,7 +131,7 @@ public:
*/
QDirIteratorPrivate::QDirIteratorPrivate(const QString &path, const QStringList &nameFilters,
QDir::Filters filters, QDirIterator::IteratorFlags flags)
- : engine(0), path(path), iteratorFlags(flags),
+ : engine(QAbstractFileEngine::create(path)), path(path), iteratorFlags(flags),
filters(filters), nameFilters(nameFilters)
{
if (QDir::NoFilter == filters)
@@ -165,7 +165,7 @@ void QDirIteratorPrivate::pushDirectory(const QFileInfo &fileInfo)
if (iteratorFlags & QDirIterator::FollowSymlinks)
visitedLinks << fileInfo.canonicalFilePath();
- if (engine || (engine = QAbstractFileEngine::create(this->path))) {
+ if (engine) {
engine->setFileName(path);
QAbstractFileEngineIterator *it = engine->beginEntryList(filters, nameFilters);
if (it) {