diff options
author | Thomas Zander <t.zander@nokia.com> | 2010-09-23 09:14:01 (GMT) |
---|---|---|
committer | Thomas Zander <t.zander@nokia.com> | 2010-09-23 15:29:38 (GMT) |
commit | 52090d6e292c165bfb08140c28068b796e295b10 (patch) | |
tree | fbc1fa750b5629ce80bfcd0774767ff4eb228f15 | |
parent | d7df693b54337ea5050391751ae3243cee2f9159 (diff) | |
download | Qt-52090d6e292c165bfb08140c28068b796e295b10.zip Qt-52090d6e292c165bfb08140c28068b796e295b10.tar.gz Qt-52090d6e292c165bfb08140c28068b796e295b10.tar.bz2 |
Make setPermissions update meta
in the unix QFileSystemEngine::setPermissions we now update the
QFileSystemMetaData instance passed in on success, to avoid
another stat later.
Reviewed-by: João Abecasis
-rw-r--r-- | src/corelib/io/qfilesystemengine_unix.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index e85eb00..060cf25 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -575,7 +575,13 @@ bool QFileSystemEngine::setPermissions(const QFileSystemEntry &entry, QFile::Per if (permissions & QFile::ExeOther) mode |= S_IXOTH; - return ::chmod(entry.nativeFilePath().constData(), mode) == 0; + bool success = ::chmod(entry.nativeFilePath().constData(), mode) == 0; + if (success && data) { + data->entryFlags &= ~QFileSystemMetaData::Permissions; + data->entryFlags |= QFileSystemMetaData::MetaDataFlag(uint(permissions)); + data->knownFlagsMask |= QFileSystemMetaData::Permissions; + } + return success; } QString QFileSystemEngine::homePath() |