aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2018-05-09 14:20:13 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2018-05-09 13:09:58 +0000
commitb29168f50c9b57c229364fccd25f20ed9b2a01c7 (patch)
tree4cc1de999a467d600adb4e816d4391b0ce0c895e /src
parent357bbf296d515ff8d2761d32a6d2818484791eca (diff)
Fix FileInfo::isDir() on Windows
The function returned true for non-existing files. Change-Id: If3c3d9d1d89b3b1b70414d1b3168bd091d4f75a8 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/lib/corelib/tools/fileinfo.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/corelib/tools/fileinfo.cpp b/src/lib/corelib/tools/fileinfo.cpp
index b8fa189ab..c4ba0e5e0 100644
--- a/src/lib/corelib/tools/fileinfo.cpp
+++ b/src/lib/corelib/tools/fileinfo.cpp
@@ -339,7 +339,7 @@ FileTime FileInfo::lastStatusChange() const
bool FileInfo::isDir() const
{
- return z(m_stat)->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
+ return exists() && z(m_stat)->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
}
static QString resolveSymlinks(const QString &fileName)