Fix incorrect QFileInfo permissions on windows

Requesting the write permission marked the read permission as known
without having retrieved it. A subsequent request for read permission
would return false.

Task-Number: QTBUG-20714
Reviewed-By: mread
(cherry picked from commit bf69c7e0af67ec877da4fee244386e538fa1c01d)

Change-Id: I74fd118fcdd3b222098eda2718823a36931424a1
Reviewed-on: http://codereview.qt-project.org/6159
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
This commit is contained in:
Shane Kearns 2011-10-06 13:46:30 +01:00 committed by Qt by Nokia
parent 0b67ad9db2
commit df08cb7090

View File

@ -692,7 +692,7 @@ bool QFileSystemEngine::fillPermissions(const QFileSystemEntry &entry, QFileSyst
if (what & QFileSystemMetaData::UserWritePermission) {
if (::_waccess((wchar_t*)entry.nativeFilePath().utf16(), W_OK) == 0)
data.entryFlags |= QFileSystemMetaData::UserWritePermission;
data.knownFlagsMask |= QFileSystemMetaData::UserReadPermission;
data.knownFlagsMask |= QFileSystemMetaData::UserWritePermission;
}
}