diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/corelib/io/qnoncontiguousbytedevice.cpp | 29 | ||||
| -rw-r--r-- | src/corelib/io/qnoncontiguousbytedevice_p.h | 3 | ||||
| -rw-r--r-- | src/network/access/qnetworkaccessbackend.cpp | 6 | ||||
| -rw-r--r-- | src/network/access/qnetworkreplyhttpimpl.cpp | 8 |
4 files changed, 2 insertions, 44 deletions
diff --git a/src/corelib/io/qnoncontiguousbytedevice.cpp b/src/corelib/io/qnoncontiguousbytedevice.cpp index 11510a83972..1c10ef9f83d 100644 --- a/src/corelib/io/qnoncontiguousbytedevice.cpp +++ b/src/corelib/io/qnoncontiguousbytedevice.cpp @@ -94,17 +94,7 @@ QT_BEGIN_NAMESPACE Moves the internal read pointer back to the beginning. Returns \c false if this was not possible. - \sa atEnd(), disableReset() - - \internal -*/ -/*! - \fn void QNonContiguousByteDevice::disableReset() - - Disable the reset() call, e.g. it will always - do nothing and return false. - - \sa reset() + \sa atEnd() \internal */ @@ -131,7 +121,7 @@ QT_BEGIN_NAMESPACE \internal */ -QNonContiguousByteDevice::QNonContiguousByteDevice() : QObject((QObject*)0), resetDisabled(false) +QNonContiguousByteDevice::QNonContiguousByteDevice() : QObject((QObject*)0) { } @@ -139,11 +129,6 @@ QNonContiguousByteDevice::~QNonContiguousByteDevice() { } -void QNonContiguousByteDevice::disableReset() -{ - resetDisabled = true; -} - // FIXME we should scrap this whole implementation and instead change the ByteArrayImpl to be able to cope with sub-arrays? QNonContiguousByteDeviceBufferImpl::QNonContiguousByteDeviceBufferImpl(QBuffer *b) : QNonContiguousByteDevice() { @@ -176,8 +161,6 @@ bool QNonContiguousByteDeviceBufferImpl::atEnd() bool QNonContiguousByteDeviceBufferImpl::reset() { - if (resetDisabled) - return false; return arrayImpl->reset(); } @@ -224,9 +207,6 @@ bool QNonContiguousByteDeviceByteArrayImpl::atEnd() bool QNonContiguousByteDeviceByteArrayImpl::reset() { - if (resetDisabled) - return false; - currentPosition = 0; return true; } @@ -275,9 +255,6 @@ bool QNonContiguousByteDeviceRingBufferImpl::atEnd() bool QNonContiguousByteDeviceRingBufferImpl::reset() { - if (resetDisabled) - return false; - currentPosition = 0; return true; } @@ -378,8 +355,6 @@ bool QNonContiguousByteDeviceIoDeviceImpl::atEnd() bool QNonContiguousByteDeviceIoDeviceImpl::reset() { - if (resetDisabled) - return false; 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 diff --git a/src/corelib/io/qnoncontiguousbytedevice_p.h b/src/corelib/io/qnoncontiguousbytedevice_p.h index 1be28ff4b30..d36422e82cd 100644 --- a/src/corelib/io/qnoncontiguousbytedevice_p.h +++ b/src/corelib/io/qnoncontiguousbytedevice_p.h @@ -62,8 +62,6 @@ public: virtual bool advanceReadPointer(qint64 amount) = 0; virtual bool atEnd() = 0; virtual bool reset() = 0; - void disableReset(); - bool isResetDisabled() { return resetDisabled; } virtual qint64 size() = 0; virtual ~QNonContiguousByteDevice(); @@ -72,7 +70,6 @@ protected: QNonContiguousByteDevice(); - bool resetDisabled; Q_SIGNALS: void readyRead(); void readProgress(qint64 current, qint64 total); diff --git a/src/network/access/qnetworkaccessbackend.cpp b/src/network/access/qnetworkaccessbackend.cpp index a4067daf493..f8791361634 100644 --- a/src/network/access/qnetworkaccessbackend.cpp +++ b/src/network/access/qnetworkaccessbackend.cpp @@ -129,12 +129,6 @@ QNonContiguousByteDevice* QNetworkAccessBackend::createUploadByteDevice() return 0; } - bool bufferDisallowed = - reply->request.attribute(QNetworkRequest::DoNotBufferUploadDataAttribute, - QVariant(false)) == QVariant(true); - if (bufferDisallowed) - uploadByteDevice->disableReset(); - // We want signal emissions only for normal asynchronous uploads if (!isSynchronous()) connect(uploadByteDevice.data(), SIGNAL(readProgress(qint64,qint64)), this, SLOT(emitReplyUploadProgress(qint64,qint64))); diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp index 48270b1f918..e7c1b61d4d9 100644 --- a/src/network/access/qnetworkreplyhttpimpl.cpp +++ b/src/network/access/qnetworkreplyhttpimpl.cpp @@ -856,8 +856,6 @@ void QNetworkReplyHttpImplPrivate::postRequest() if (uploadByteDevice) { QNonContiguousByteDeviceThreadForwardImpl *forwardUploadDevice = new QNonContiguousByteDeviceThreadForwardImpl(uploadByteDevice->atEnd(), uploadByteDevice->size()); - if (uploadByteDevice->isResetDisabled()) - forwardUploadDevice->disableReset(); forwardUploadDevice->setParent(delegate); // needed to make sure it is moved on moveToThread() delegate->httpRequest.setUploadByteDevice(forwardUploadDevice); @@ -1896,12 +1894,6 @@ QNonContiguousByteDevice* QNetworkReplyHttpImplPrivate::createUploadByteDevice() return 0; } - bool bufferDisallowed = - request.attribute(QNetworkRequest::DoNotBufferUploadDataAttribute, - QVariant(false)) == QVariant(true); - if (bufferDisallowed) - uploadByteDevice->disableReset(); - // We want signal emissions only for normal asynchronous uploads if (!synchronous) QObject::connect(uploadByteDevice.data(), SIGNAL(readProgress(qint64,qint64)), |
