From d703c131bae6fb89672a55e1bcd735e2514e75ac Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Tue, 11 Aug 2009 18:11:16 +0200 Subject: don't set FileType flag when link's target doesn't exists Merge-request: 1176 Reviewed-by: Joerg Bornemann --- src/corelib/io/qfsfileengine_win.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index 11d1ca6..25fbae8 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -896,7 +896,7 @@ static inline bool rmDir(const QString &path) static inline bool isDirPath(const QString &dirPath, bool *existed) { QString path = dirPath; - if (path.length() == 2 &&path.at(1) == QLatin1Char(':')) + if (path.length() == 2 && path.at(1) == QLatin1Char(':')) path += QLatin1Char('\\'); DWORD fileAttrib = ::GetFileAttributes((wchar_t*)QFSFileEnginePrivate::longFileName(path).utf16()); @@ -1523,9 +1523,10 @@ QAbstractFileEngine::FileFlags QFSFileEngine::fileFlags(QAbstractFileEngine::Fil ret |= LinkType; QString l = readLink(d->filePath); if (!l.isEmpty()) { - if (isDirPath(l, 0)) + bool existed = false; + if (isDirPath(l, &existed) && existed) ret |= DirectoryType; - else + else if (existed) ret |= FileType; } } else if (d->doStat()) { -- cgit v0.12