From 9081c1b97532f76b350a712c8e8e6d0bd4cadfdc Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Thu, 23 Jul 2009 14:04:19 +0200 Subject: Fix two errors of QDirIteratorPrivate::matchesFilters() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/corelib/io/qdiriterator.cpp | 10 ++-------- 1 file 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; } -- cgit v0.12