From 2964718224c0ed356511335742368d4fc421c6bd Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Fri, 29 Jan 2010 13:12:38 +0100 Subject: QDir::entry(Info)List(): really use cached data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test conditions for using cached file lists were wrong and preventing list reuse unless no filters or sorting flags were previously set. Merge-request: 445 Reviewed-by: João Abecasis --- src/corelib/io/qdir.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index eb5f3de..6b79cae 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -1353,10 +1353,12 @@ QStringList QDir::entryList(const QStringList &nameFilters, Filters filters, #endif if (sort == NoSort) sort = d->data->sort; - if (filters == NoFilter && sort == NoSort && nameFilters == d->data->nameFilters) { + + if (filters == d->data->filters && sort == d->data->sort && nameFilters == d->data->nameFilters) { d->updateFileLists(); return d->data->files; } + QFileInfoList l; QDirIterator it(d->data->path, nameFilters, filters); while (it.hasNext()) { @@ -1398,10 +1400,12 @@ QFileInfoList QDir::entryInfoList(const QStringList &nameFilters, Filters filter #endif if (sort == NoSort) sort = d->data->sort; - if (filters == NoFilter && sort == NoSort && nameFilters == d->data->nameFilters) { + + if (filters == d->data->filters && sort == d->data->sort && nameFilters == d->data->nameFilters) { d->updateFileLists(); return d->data->fileInfos; } + QFileInfoList l; QDirIterator it(d->data->path, nameFilters, filters); while (it.hasNext()) { -- cgit v0.12