summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qdirlisting.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/corelib/io/qdirlisting.cpp b/src/corelib/io/qdirlisting.cpp
index c626033dcdb..1fec92a01e2 100644
--- a/src/corelib/io/qdirlisting.cpp
+++ b/src/corelib/io/qdirlisting.cpp
@@ -510,16 +510,14 @@ bool QDirListingPrivate::matchesFilters(QDirEntryInfo &entryInfo) const
if (!iteratorFlags.testAnyFlag(F::IncludeHidden) && entryInfo.isHidden())
return false;
- if (entryInfo.isSymLink()) {
- // With ResolveSymlinks, we look at the type of the link's target,
- // and exclude broken symlinks (where the target doesn't exist).
- if (iteratorFlags.testAnyFlag(F::ResolveSymlinks)) {
- if (!entryInfo.exists())
- return false;
- } else if (iteratorFlags.testAnyFlags(F::FilesOnly)
- || iteratorFlags.testAnyFlags(F::DirsOnly)) {
- return false; // symlink is not a file or dir
- }
+ // With ResolveSymlinks, we look at the type of the link's target,
+ // and exclude broken symlinks (where the target doesn't exist).
+ if (iteratorFlags.testAnyFlag(F::ResolveSymlinks)) {
+ if (entryInfo.isSymLink() && !entryInfo.exists())
+ return false;
+ } else if ((iteratorFlags.testAnyFlags(F::FilesOnly)
+ || iteratorFlags.testAnyFlags(F::DirsOnly)) && entryInfo.isSymLink()) {
+ return false; // symlink is not a file or dir
}
if (iteratorFlags.testAnyFlag(F::ExcludeOther)