summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorPeter Hartmann <phartmann@blackberry.com>2013-03-25 15:55:40 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-25 20:50:26 +0100
commitffe45f1896adfff93258b917f6a566dcc06a6597 (patch)
tree10a33fc980c1d6b8f080d3d360db5caab488e67f /src/corelib/io
parent83c9d22d4442e6c5ca3bb9243a721a286ddd1ea2 (diff)
QNonContiguousByteDevice: roll back complete internal state in reset()
... otherwise we would not start reading from the beginning when the device was reset. Change-Id: Ida196eb40790fba56ff2eed782fd93a3015222f9 Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qnoncontiguousbytedevice.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/corelib/io/qnoncontiguousbytedevice.cpp b/src/corelib/io/qnoncontiguousbytedevice.cpp
index c0fbbaf103..253aa2aafb 100644
--- a/src/corelib/io/qnoncontiguousbytedevice.cpp
+++ b/src/corelib/io/qnoncontiguousbytedevice.cpp
@@ -391,6 +391,13 @@ bool QNonContiguousByteDeviceIoDeviceImpl::reset()
bool reset = (initialPosition == 0) ? device->reset() : device->seek(initialPosition);
if (reset) {
eof = false; // assume eof is false, it will be true after a read has been attempted
+ totalAdvancements = 0; //reset the progress counter
+ if (currentReadBuffer) {
+ delete currentReadBuffer;
+ currentReadBuffer = 0;
+ }
+ currentReadBufferAmount = 0;
+ currentReadBufferPosition = 0;
return true;
}