summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2022-02-15 08:13:03 -0800
committerThiago Macieira <thiago.macieira@intel.com>2022-02-16 01:47:09 -0800
commitd34282dba0ebe67c16c1ee6e25d85f019b48b615 (patch)
tree268fa35865bfd2af991e6796ad5acd0b0ee41b14
parent8f1a827d91da79f30cc8bb34fe4651b9523b51ab (diff)
QFile::copy: add the underlying error messages to ours
Fixes: QTBUG-100867 Pick-to: 6.3 Change-Id: Ic15405335d804bdea761fffd16d401a7c16f32f9 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
-rw-r--r--src/corelib/io/qfile.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp
index 2329613f45..4b4c624fef 100644
--- a/src/corelib/io/qfile.cpp
+++ b/src/corelib/io/qfile.cpp
@@ -817,7 +817,8 @@ QFile::copy(const QString &newName)
totalRead += in;
if (in != out.write(block, in)) {
close();
- d->setError(QFile::CopyError, tr("Failure to write block"));
+ d->setError(QFile::CopyError, tr("Failure to write block: %1")
+ .arg(out.errorString()));
error = true;
break;
}
@@ -837,7 +838,8 @@ QFile::copy(const QString &newName)
if (!out.rename(newName)) {
error = true;
close();
- d->setError(QFile::CopyError, tr("Cannot create %1 for output").arg(newName));
+ d->setError(QFile::CopyError, tr("Cannot create %1 for output: %1")
+ .arg(newName, out.errorString()));
}
}
#ifdef QT_NO_TEMPORARYFILE