summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qtemporaryfile.cpp
diff options
context:
space:
mode:
authorJoão Abecasis <joao@abecasis.name>2009-04-15 12:34:57 (GMT)
committerJoão Abecasis <joao@abecasis.name>2009-05-22 12:33:42 (GMT)
commit662e8997e9777c6661dde2134e43e35963a12cb6 (patch)
tree27d495931565b4324d73d6d26494d0631743df31 /src/corelib/io/qtemporaryfile.cpp
parent3672deb3b35fc0660c58a8ecc741b989dd0bfc8a (diff)
downloadQt-662e8997e9777c6661dde2134e43e35963a12cb6.zip
Qt-662e8997e9777c6661dde2134e43e35963a12cb6.tar.gz
Qt-662e8997e9777c6661dde2134e43e35963a12cb6.tar.bz2
QTemporaryFile: don't clear filePath if remove fails
Reviewed-by: MariusSO Reviewed-by: Peter Hartmann Reviewed-by: Thiago
Diffstat (limited to 'src/corelib/io/qtemporaryfile.cpp')
-rw-r--r--src/corelib/io/qtemporaryfile.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp
index 6a9125c..b0809c6 100644
--- a/src/corelib/io/qtemporaryfile.cpp
+++ b/src/corelib/io/qtemporaryfile.cpp
@@ -364,9 +364,11 @@ bool QTemporaryFileEngine::remove()
// Since the QTemporaryFileEngine::close() does not really close the file,
// we must explicitly call QFSFileEngine::close() before we remove it.
QFSFileEngine::close();
- bool removed = QFSFileEngine::remove();
- d->filePath.clear();
- return removed;
+ if (QFSFileEngine::remove()) {
+ d->filePath.clear();
+ return true;
+ }
+ return false;
}
bool QTemporaryFileEngine::close()