From 9901bfe914ab58655f0cc95ddea08d2d171af459 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Tue, 7 Apr 2015 16:46:40 +0400 Subject: Simplify permission flag handling a bit Change-Id: I753f7a398c39e7300821658f27e4813c591eebc3 Reviewed-by: Friedemann Kleint Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qfilesystemengine_unix.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/corelib/io/qfilesystemengine_unix.cpp') diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index c4fb709ddf..2c9fed530b 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -662,17 +662,11 @@ bool QFileSystemEngine::removeFile(const QFileSystemEntry &entry, QSystemError & bool QFileSystemEngine::setPermissions(const QFileSystemEntry &entry, QFile::Permissions permissions, QSystemError &error, QFileSystemMetaData *data) { mode_t mode = 0; - if (permissions & QFile::ReadOwner) + if (permissions & (QFile::ReadOwner | QFile::ReadUser)) mode |= S_IRUSR; - if (permissions & QFile::WriteOwner) + if (permissions & (QFile::WriteOwner | QFile::WriteUser)) mode |= S_IWUSR; - if (permissions & QFile::ExeOwner) - mode |= S_IXUSR; - if (permissions & QFile::ReadUser) - mode |= S_IRUSR; - if (permissions & QFile::WriteUser) - mode |= S_IWUSR; - if (permissions & QFile::ExeUser) + if (permissions & (QFile::ExeOwner | QFile::ExeUser)) mode |= S_IXUSR; if (permissions & QFile::ReadGroup) mode |= S_IRGRP; -- cgit v1.2.3