diff options
author | Ritt Konstantin <ritt.ks@gmail.com> | 2009-07-24 12:25:36 (GMT) |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@trolltech.com> | 2009-07-24 12:25:36 (GMT) |
commit | 034e3b490238bacded8b5c7db3d296833a850d6b (patch) | |
tree | 80a50bd5ff195cc5c82187512df7364a1aab4d42 | |
parent | 11fb6f876b94869921fa9b560ce8a3f6ae38e1f5 (diff) | |
download | Qt-034e3b490238bacded8b5c7db3d296833a850d6b.zip Qt-034e3b490238bacded8b5c7db3d296833a850d6b.tar.gz Qt-034e3b490238bacded8b5c7db3d296833a850d6b.tar.bz2 |
fix minor issue introduced in 6ca14dc
GetFileAttributes call can fire at least one more error - ERROR_NOT_READY (21)
since now the fallback code will be executed for basic cases only
Merge-request: 984
Reviewed-by: Joerg Bornemann <joerg.bornemann@trolltech.com>
-rw-r--r-- | src/corelib/io/qfsfileengine_win.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index 53f0144..819034a 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -529,8 +529,7 @@ qint64 QFSFileEnginePrivate::nativeSize() const GetFileExInfoStandard, &attribData); if (!ok) { int errorCode = GetLastError(); - if (errorCode != ERROR_INVALID_NAME - && errorCode != ERROR_FILE_NOT_FOUND && errorCode != ERROR_PATH_NOT_FOUND) { + if (errorCode == ERROR_ACCESS_DENIED || errorCode == ERROR_SHARING_VIOLATION) { QByteArray path = nativeFilePath; // path for the FindFirstFile should not end with a trailing slash while (path.endsWith('\\')) @@ -903,8 +902,7 @@ static inline bool isDirPath(const QString &dirPath, bool *existed) DWORD fileAttrib = ::GetFileAttributes((wchar_t*)QFSFileEnginePrivate::longFileName(path).utf16()); if (fileAttrib == INVALID_FILE_ATTRIBUTES) { int errorCode = GetLastError(); - if (errorCode != ERROR_INVALID_NAME - && errorCode != ERROR_FILE_NOT_FOUND && errorCode != ERROR_PATH_NOT_FOUND) { + if (errorCode == ERROR_ACCESS_DENIED || errorCode == ERROR_SHARING_VIOLATION) { // path for the FindFirstFile should not end with a trailing slash while (path.endsWith(QLatin1Char('\\'))) path.chop(1); @@ -1194,8 +1192,7 @@ bool QFSFileEnginePrivate::doStat() const fileAttrib = GetFileAttributes((wchar_t*)QFSFileEnginePrivate::longFileName(fname).utf16()); if (fileAttrib == INVALID_FILE_ATTRIBUTES) { int errorCode = GetLastError(); - if (errorCode != ERROR_INVALID_NAME - && errorCode != ERROR_FILE_NOT_FOUND && errorCode != ERROR_PATH_NOT_FOUND) { + if (errorCode == ERROR_ACCESS_DENIED || errorCode == ERROR_SHARING_VIOLATION) { QString path = QDir::toNativeSeparators(fname); // path for the FindFirstFile should not end with a trailing slash while (path.endsWith(QLatin1Char('\\'))) @@ -1810,8 +1807,7 @@ QDateTime QFSFileEngine::fileTime(FileTime time) const bool ok = ::GetFileAttributesEx((wchar_t*)QFSFileEnginePrivate::longFileName(d->filePath).utf16(), GetFileExInfoStandard, &attribData); if (!ok) { int errorCode = GetLastError(); - if (errorCode != ERROR_INVALID_NAME - && errorCode != ERROR_FILE_NOT_FOUND && errorCode != ERROR_PATH_NOT_FOUND) { + if (errorCode == ERROR_ACCESS_DENIED || errorCode == ERROR_SHARING_VIOLATION) { QString path = QDir::toNativeSeparators(d->filePath); // path for the FindFirstFile should not end with a trailing slash while (path.endsWith(QLatin1Char('\\'))) |