diff options
author | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2010-09-17 14:04:35 (GMT) |
---|---|---|
committer | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2010-09-17 14:37:02 (GMT) |
commit | 768009af920c642834b1730136d9c8b156277c1d (patch) | |
tree | bcac02ee41f3f91a1a372cae25e1cf3ef80c51e9 | |
parent | 206f49020bce11e142c4290b6655ac7c15592b43 (diff) | |
download | Qt-768009af920c642834b1730136d9c8b156277c1d.zip Qt-768009af920c642834b1730136d9c8b156277c1d.tar.gz Qt-768009af920c642834b1730136d9c8b156277c1d.tar.bz2 |
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
-rw-r--r-- | src/corelib/io/qfilesystemengine_win.cpp | 9 |
1 files 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 |