diff options
author | Shane Kearns <ext-shane.2.kearns@nokia.com> | 2012-05-30 11:59:59 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-09 08:46:12 +0200 |
commit | 92c458b3521909c9db200beb80293a5c64b9b5f8 (patch) | |
tree | 81f7911a219220c45297887ee3aabdb46f404d10 /src/corelib/io/qfile.cpp | |
parent | 422f1b68d2caf49e9df45b24f486340835c8dbc7 (diff) |
Fix QFile append on windows
1. make windows file engine seek to end on open to match unix/symbian
2. make qfile forcibly seek the file engine in case a custom file
engine has the same bug.
Task-number: QTBUG-25906
Change-Id: I62a26519a9401e547ff77bd8a71027cb361dc671
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Diffstat (limited to 'src/corelib/io/qfile.cpp')
-rw-r--r-- | src/corelib/io/qfile.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index c4bc612fab..8eea2449c9 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -1036,8 +1036,11 @@ bool QFile::open(OpenMode mode) #endif { QIODevice::open(mode); - if (mode & Append) - seek(size()); + if (mode & Append) { + //The file engine should have done this in open(), + //this is a workaround for backward compatibility + fileEngine()->seek(size()); + } return true; } QFile::FileError err = d->fileEngine->error(); |