summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoão Abecasis <joao@abecasis.name>2009-07-17 13:29:12 (GMT)
committerJoão Abecasis <joao@abecasis.name>2009-07-22 12:36:15 (GMT)
commitf2dce82831706a38cd97225edb2edc0ed2a1520e (patch)
treefbd6a02a1127a271cbef6bcbe9994ad9472130bd /src
parent615e3e55fc56a5f5378db404cd89a443e7e74e56 (diff)
downloadQt-f2dce82831706a38cd97225edb2edc0ed2a1520e.zip
Qt-f2dce82831706a38cd97225edb2edc0ed2a1520e.tar.gz
Qt-f2dce82831706a38cd97225edb2edc0ed2a1520e.tar.bz2
QDirIterator refactoring
done was set no sooner and no later than the file engine iterators stack was emptied (in a single threaded setting, anyway). There is no need to maintain additional state separately. Reviewed-by: Marius Storm-Olsen
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qdiriterator.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/corelib/io/qdiriterator.cpp b/src/corelib/io/qdiriterator.cpp
index 51bb98a..0ea7097 100644
--- a/src/corelib/io/qdiriterator.cpp
+++ b/src/corelib/io/qdiriterator.cpp
@@ -122,7 +122,6 @@ public:
QDir::Filters filters;
QStringList nameFilters;
bool first;
- bool done;
QDirIterator *q;
};
@@ -134,7 +133,7 @@ QDirIteratorPrivate::QDirIteratorPrivate(const QString &path, const QStringList
QDir::Filters filters, QDirIterator::IteratorFlags flags)
: engine(0), path(path), iteratorFlags(flags),
filters(filters), nameFilters(nameFilters),
- first(true), done(false)
+ first(true)
{
if (QDir::NoFilter == filters)
this->filters = QDir::AllEntries;
@@ -209,8 +208,8 @@ void QDirIteratorPrivate::advance()
if (!foundDirectory)
delete fileEngineIterators.pop();
}
+
currentFileInfo = nextFileInfo;
- done = true;
}
/*!
@@ -464,7 +463,7 @@ bool QDirIterator::hasNext() const
d->first = false;
d->advance();
}
- return !d->done;
+ return !d->fileEngineIterators.isEmpty();
}
/*!