summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBenjamin Poulain <benjamin.poulain@nokia.com>2009-07-23 12:04:19 (GMT)
committerBenjamin Poulain <benjamin.poulain@nokia.com>2009-07-23 12:05:03 (GMT)
commit9081c1b97532f76b350a712c8e8e6d0bd4cadfdc (patch)
tree5be26c4de06b00d8760688b64635423202865a72 /src
parent86422951df8073babe8d9dcfbd63fe216aa4662e (diff)
downloadQt-9081c1b97532f76b350a712c8e8e6d0bd4cadfdc.zip
Qt-9081c1b97532f76b350a712c8e8e6d0bd4cadfdc.tar.gz
Qt-9081c1b97532f76b350a712c8e8e6d0bd4cadfdc.tar.bz2
Fix two errors of QDirIteratorPrivate::matchesFilters()
The filter for includeSystem was exectuted twice. The second time was not correct according to d9a620633d0a5fa5e69ab06ec9a706118f3df2a6 (QFileInfo::exists() can return false for system file). For skipDirs, a parenthesis was missing in the test of includeHidden and includeSystem. This was introduced in the refactoring of 44766d265c16551043d2739171069fe042c40091 Reviewed-by: João Abecasis
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qdiriterator.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/corelib/io/qdiriterator.cpp b/src/corelib/io/qdiriterator.cpp
index 3bfea65..30d2558 100644
--- a/src/corelib/io/qdiriterator.cpp
+++ b/src/corelib/io/qdiriterator.cpp
@@ -309,17 +309,11 @@ bool QDirIteratorPrivate::matchesFilters(const QString &fileName, const QFileInf
|| (!fi.exists() && fi.isSymLink())))
return false;
-
- if (!includeSystem && !dotOrDotDot && ((fi.exists() && !fi.isFile() && !fi.isDir() && !fi.isSymLink())
- || (!fi.exists() && fi.isSymLink()))) {
- return false;
- }
-
// skip directories
const bool skipDirs = !(filters & (QDir::Dirs | QDir::AllDirs));
if (skipDirs && fi.isDir()) {
- if (!(includeHidden && !dotOrDotDot && fi.isHidden())
- || (includeSystem && !fi.exists() && fi.isSymLink()))
+ if (!((includeHidden && !dotOrDotDot && fi.isHidden())
+ || (includeSystem && !fi.exists() && fi.isSymLink())))
return false;
}