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>
This commit is contained in:
Peter Hartmann 2013-03-25 15:55:40 +01:00 committed by The Qt Project
parent 83c9d22d44
commit ffe45f1896

View File

@ -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;
}