summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorRitt Konstantin <ritt.ks@gmail.com>2009-08-11 16:11:16 (GMT)
committerJoerg Bornemann <joerg.bornemann@trolltech.com>2009-08-11 16:16:38 (GMT)
commitd703c131bae6fb89672a55e1bcd735e2514e75ac (patch)
treeef32ae6c435dffe2dbf16f91b49aab09db2a7e14 /src/corelib
parenteb4efda5c8a9a32c38945e26f68217b170b87ffb (diff)
downloadQt-d703c131bae6fb89672a55e1bcd735e2514e75ac.zip
Qt-d703c131bae6fb89672a55e1bcd735e2514e75ac.tar.gz
Qt-d703c131bae6fb89672a55e1bcd735e2514e75ac.tar.bz2
don't set FileType flag when link's target doesn't exists
Merge-request: 1176 Reviewed-by: Joerg Bornemann <joerg.bornemann@trolltech.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/io/qfsfileengine_win.cpp7
1 files 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()) {