summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWater-Team <water@pad.test.qt.nokia.com>2011-11-01 00:00:12 (GMT)
committerWater-Team <water@pad.test.qt.nokia.com>2011-11-01 00:00:12 (GMT)
commitf4dc4e6370289b022e4b9d05b1afdac59e7813d1 (patch)
treec5f73a4aad5bc850c5c0da7f84c01c946f935224 /src
parentecc412f02004d4e6c0b56d4daa54a387131619dc (diff)
parentb8ab878f68504b56c1ed8b434b769494feb827a1 (diff)
downloadQt-f4dc4e6370289b022e4b9d05b1afdac59e7813d1.zip
Qt-f4dc4e6370289b022e4b9d05b1afdac59e7813d1.tar.gz
Qt-f4dc4e6370289b022e4b9d05b1afdac59e7813d1.tar.bz2
Merge branch '4.8-upstream' into master-water
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qfile.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp
index d08574d..cdee7ce 100644
--- a/src/corelib/io/qfile.cpp
+++ b/src/corelib/io/qfile.cpp
@@ -918,6 +918,7 @@ QFile::copy(const QString &newName)
#endif
if (error) {
out.close();
+ close();
d->setError(QFile::CopyError, tr("Cannot open for output"));
} else {
char block[4096];
@@ -928,6 +929,7 @@ QFile::copy(const QString &newName)
break;
totalRead += in;
if(in != out.write(block, in)) {
+ close();
d->setError(QFile::CopyError, tr("Failure to write block"));
error = true;
break;
@@ -941,6 +943,7 @@ QFile::copy(const QString &newName)
}
if (!error && !out.rename(newName)) {
error = true;
+ close();
d->setError(QFile::CopyError, tr("Cannot create %1 for output").arg(newName));
}
#ifdef QT_NO_TEMPORARYFILE
@@ -951,10 +954,10 @@ QFile::copy(const QString &newName)
out.setAutoRemove(false);
#endif
}
- close();
}
if(!error) {
QFile::setPermissions(newName, permissions());
+ close();
unsetError();
return true;
}