diff options
author | Ritt Konstantin <ritt.ks@gmail.com> | 2010-01-29 12:12:38 (GMT) |
---|---|---|
committer | João Abecasis <joao@trolltech.com> | 2010-01-29 12:12:38 (GMT) |
commit | 2964718224c0ed356511335742368d4fc421c6bd (patch) | |
tree | 00124d76f467a9a533b1510486ec330a55c02082 /src/corelib/io | |
parent | 0b7474c8ef9167bef92f8a09e8a818334822aa36 (diff) | |
download | Qt-2964718224c0ed356511335742368d4fc421c6bd.zip Qt-2964718224c0ed356511335742368d4fc421c6bd.tar.gz Qt-2964718224c0ed356511335742368d4fc421c6bd.tar.bz2 |
QDir::entry(Info)List(): really use cached data
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 <joao@trolltech.com>
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qdir.cpp | 8 |
1 files 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()) { |