From 768009af920c642834b1730136d9c8b156277c1d Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Fri, 17 Sep 2010 16:04:35 +0200 Subject: Fix QDir autotest failures on windows The canonicalName now checks the file existance before it returns the path. It will also fill in the metadata in case the existance was never checked before. Reviewed-by: Joao --- src/corelib/io/qfilesystemengine_win.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp index 119ed7c..20b9b4d 100644 --- a/src/corelib/io/qfilesystemengine_win.cpp +++ b/src/corelib/io/qfilesystemengine_win.cpp @@ -503,8 +503,13 @@ QFileSystemEntry QFileSystemEngine::getLinkTarget(const QFileSystemEntry &link, //static QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry, QFileSystemMetaData &data) { - // The caller has to verify whether the file exists or not. - return QFileSystemEntry(slowCanonicalized(absoluteName(entry).filePath())); + if (data.missingFlags(QFileSystemMetaData::ExistsAttribute)) + QFileSystemEngine::fillMetaData(entry, data, QFileSystemMetaData::ExistsAttribute); + + if (data.exists()) + return QFileSystemEntry(slowCanonicalized(absoluteName(entry).filePath())); + else + return QFileSystemEntry(); } //static -- cgit v0.12