diff options
author | Janne Anttila <janne.anttila@digia.com> | 2009-04-29 15:18:10 (GMT) |
---|---|---|
committer | Janne Anttila <janne.anttila@digia.com> | 2009-04-29 15:18:10 (GMT) |
commit | 37c49413e8ba1880bce5989c1b2f1d0d9bb0e663 (patch) | |
tree | 63d8be69a6a95e81006812b26d2f6ce49f7f3d25 | |
parent | 7e4e7f66ab5f799c4a4ac71141b322841d05153a (diff) | |
download | Qt-37c49413e8ba1880bce5989c1b2f1d0d9bb0e663.zip Qt-37c49413e8ba1880bce5989c1b2f1d0d9bb0e663.tar.gz Qt-37c49413e8ba1880bce5989c1b2f1d0d9bb0e663.tar.bz2 |
Fixed temporary file rename problem in Symbian OS.
In Symbian OS temp file rename will always go to fallback solution
since close for temp file does not really close the handle. The fallback
implements rename by copy and remove. But in symbian OS also the remove
after copy failed since it was done through local 'in' object. However
the file was still open in object doing the remove.
The fix is to close the local 'in' object and use current 'this' object to
remove the file. This object points to QTemporaryFile and it will make sure
that temp file is first closed before trying to remove.
-rw-r--r-- | src/corelib/io/qfile.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index af10c31..01a236c 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -737,7 +737,8 @@ QFile::rename(const QString &newName) error = true; } if(!error) { - if (!in.remove()) { + in.close(); + if (!remove()) { d->setError(QFile::RenameError, tr("Cannot remove source file")); error = true; } |