summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfile.cpp
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2010-11-29 13:55:18 +0000
committerShane Kearns <shane.kearns@accenture.com>2010-11-30 11:55:56 +0000
commitcd3e03f5e70fa6d973949516f50ea05f201aac20 (patch)
treedcd7028de8ec07ca1df58f3a80ca06ff5147994f /src/corelib/io/qfile.cpp
parent9120864d7263cd1ed288770314e387de95d14bf3 (diff)
Fix buffered/unbuffered mode issues on symbian
Due to a bug in the symbian file server, files in /resource can't be opened for unbuffered read, only for default mode read. (it doesn't mask the cache control flags when doing the security check) So read will always be done in default mode. Symptom of this was that QML plugin loading failed as the plugin description in /resource could not be read. Buffered or unbuffered writes (i.e. whether the cache should be write through or write behind) are controlled by the QIODevice::Unbuffered flag, therefore it needs to be passed through to the file engine. An optimisation for unix and windows to force unbuffered mode in the file engine is inappropriate (as that is referring to buffering in the standard library, which is bypassed entirely by using the low level RFile to open files on symbian) Reviewed-by: joao
Diffstat (limited to 'src/corelib/io/qfile.cpp')
-rw-r--r--src/corelib/io/qfile.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp
index fac4ac63f4..85e78a6048 100644
--- a/src/corelib/io/qfile.cpp
+++ b/src/corelib/io/qfile.cpp
@@ -993,8 +993,14 @@ bool QFile::open(OpenMode mode)
return false;
}
+#ifdef Q_OS_SYMBIAN
+ // For symbian, the unbuffered flag is used to control write-behind cache behaviour
+ if (fileEngine()->open(mode))
+#else
// QIODevice provides the buffering, so there's no need to request it from the file engine.
- if (fileEngine()->open(mode | QIODevice::Unbuffered)) {
+ if (fileEngine()->open(mode | QIODevice::Unbuffered))
+#endif
+ {
QIODevice::open(mode);
if (mode & Append)
seek(size());