summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2010-09-13 13:57:08 (GMT)
committerShane Kearns <shane.kearns@accenture.com>2010-09-13 14:28:09 (GMT)
commit7f5417353bd71a63e962851ba598f1e2631f4a25 (patch)
tree758986884953c82d7c876a5615912900caafc9c0
parenta12e4996b8316badd7784b204ea8f22b7986f032 (diff)
downloadQt-7f5417353bd71a63e962851ba598f1e2631f4a25.zip
Qt-7f5417353bd71a63e962851ba598f1e2631f4a25.tar.gz
Qt-7f5417353bd71a63e962851ba598f1e2631f4a25.tar.bz2
Fix setPermissions in symbian
In error, it was checking the read permissions to set the read-only file attribute, when it should have been checking the write permissions. read-only = !writable. Reviewed-By: Thomas Zander
-rw-r--r--src/corelib/io/qfilesystemengine_symbian.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/io/qfilesystemengine_symbian.cpp b/src/corelib/io/qfilesystemengine_symbian.cpp
index 1ed4ee8..6bad860 100644
--- a/src/corelib/io/qfilesystemengine_symbian.cpp
+++ b/src/corelib/io/qfilesystemengine_symbian.cpp
@@ -290,7 +290,7 @@ bool QFileSystemEngine::removeFile(const QFileSystemEntry &entry)
QString targetpath = absoluteName(entry).nativeFilePath();
RFs& fs(qt_s60GetRFs());
TInt err = fs.Delete(qt_QString2TPtrC(targetpath));
- return false; // TODO error reporting;
+ return err == KErrNone; // TODO error reporting;
}
//static
@@ -300,8 +300,8 @@ bool QFileSystemEngine::setPermissions(const QFileSystemEntry &entry, QFile::Per
TUint setmask = 0;
TUint clearmask = 0;
RFs& fs(qt_s60GetRFs());
- if (permissions & (QFile::ReadOwner | QFile::ReadUser | QFile::ReadGroup | QFile::ReadOther))
- clearmask = KEntryAttReadOnly;
+ if (permissions & (QFile::WriteOwner | QFile::WriteUser | QFile::WriteGroup | QFile::WriteOther))
+ clearmask = KEntryAttReadOnly; //if anyone can write, it's not read-only
else
setmask = KEntryAttReadOnly;
TInt err = fs.SetAtt(qt_QString2TPtrC(targetpath), setmask, clearmask);
@@ -310,7 +310,7 @@ bool QFileSystemEngine::setPermissions(const QFileSystemEntry &entry, QFile::Per
data->entryFlags |= QFileSystemMetaData::MetaDataFlag(uint(permissions));
data->knownFlagsMask |= QFileSystemMetaData::Permissions;
}
- return err != KErrNone; // TODO error reporting
+ return err == KErrNone; // TODO error reporting
}
QT_END_NAMESPACE