From 37c49413e8ba1880bce5989c1b2f1d0d9bb0e663 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 29 Apr 2009 18:18:10 +0300 Subject: 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. --- src/corelib/io/qfile.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- cgit v0.12