summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Trotsenko <alex1973tr@gmail.com>2017-11-14 19:26:56 +0200
committerAlex Trotsenko <alex1973tr@gmail.com>2017-11-16 19:52:18 +0000
commit2caebf42a70cceb21b46b08e341c3cbf928b1fc8 (patch)
treee1096d778b24c4fb6306e9a637715f8a0b7d8fb0
parentc1780b932268ff070387de80a617c9763263a9f0 (diff)
QIODevice: do not clear error string on close
Keeping a description of the last device error is a more informative to the user than forcing the string to 'Unknown error'. Change-Id: Ie98fe1c94f24279fb633ce950bbe16450b0efdbd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
-rw-r--r--src/corelib/io/qiodevice.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index 82fc34c537..0a3e83206b 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -775,6 +775,7 @@ bool QIODevice::open(OpenMode mode)
d->writeBuffers.clear();
d->setReadChannelCount(isReadable() ? 1 : 0);
d->setWriteChannelCount(isWritable() ? 1 : 0);
+ d->errorString.clear();
#if defined QIODEVICE_DEBUG
printf("%p QIODevice::open(0x%x)\n", this, quint32(mode));
#endif
@@ -801,7 +802,6 @@ void QIODevice::close()
emit aboutToClose();
#endif
d->openMode = NotOpen;
- d->errorString.clear();
d->pos = 0;
d->transactionStarted = false;
d->transactionPos = 0;