summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeter Hartmann <phartmann@blackberry.com>2013-03-20 10:40:30 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-27 08:09:19 (GMT)
commit06a2d65f92cf062c4906366c1835b27d91467fbc (patch)
tree090a36840043b88e16fbb22c863933ef6cb0c6a8 /src
parente8bc7f449df5f1a94bd3d98a4f8adba6d017fa30 (diff)
downloadQt-06a2d65f92cf062c4906366c1835b27d91467fbc.zip
Qt-06a2d65f92cf062c4906366c1835b27d91467fbc.tar.gz
Qt-06a2d65f92cf062c4906366c1835b27d91467fbc.tar.bz2
QNonContiguousByteDevice: reset() instead of seek() if possible
... because e.g. QHttpMultiPartIODevice does not implement seek at all (QTBUG-30295), which would make resetting such a device fail. (cherry picked from commit 804a067846cd90e3ca31f985d539c8d75d654d82) Change-Id: I8ba1ef76cc6e7f5ebf0b39c9a75e3aea26980b82 Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qnoncontiguousbytedevice.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/io/qnoncontiguousbytedevice.cpp b/src/corelib/io/qnoncontiguousbytedevice.cpp
index 724ba22..72da5a8 100644
--- a/src/corelib/io/qnoncontiguousbytedevice.cpp
+++ b/src/corelib/io/qnoncontiguousbytedevice.cpp
@@ -389,8 +389,8 @@ bool QNonContiguousByteDeviceIoDeviceImpl::reset()
{
if (resetDisabled)
return false;
-
- if (device->seek(initialPosition)) {
+ 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) {