diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-10-31 10:28:36 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-10-31 10:28:36 (GMT) |
commit | 95c5483141e0e39737d94c9cf3e398ae7296fdc7 (patch) | |
tree | c90e1055dfb4bdf7a68b4943555e8b4b2c82ee38 /src/corelib/io | |
parent | cf5695691682957b68b67fd951addf4a52bfba84 (diff) | |
parent | 16f67b49ae5232d4d0fb19e0333f5e2ef2a65449 (diff) | |
download | Qt-95c5483141e0e39737d94c9cf3e398ae7296fdc7.zip Qt-95c5483141e0e39737d94c9cf3e398ae7296fdc7.tar.gz Qt-95c5483141e0e39737d94c9cf3e398ae7296fdc7.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
Fix QFile::copy() returning false but error() being NoError
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qfile.cpp | 5 |
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; } |