summaryrefslogtreecommitdiffstats
path: root/src/core/url_request_qrc_job_qt.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-01-21 16:01:46 +0100
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-03-07 17:08:45 +0000
commit93ca852dbf00e93c07269e8cca389bc1222130d3 (patch)
tree62b541249b8908d717f877c9adb811930bd78a24 /src/core/url_request_qrc_job_qt.cpp
parenta24df8f8e4ef0f99dbf5a6b09451bb39becaf66a (diff)
Basic adaptation to Chromium 49
Converts types, callbacks and headers to match Chromium 49. Task-number: QTBUG-51173 Change-Id: I544ef46e187105e250fea1b48b72d2c81a906640 Reviewed-by: Michael BrĂ¼ning <michael.bruning@theqtcompany.com>
Diffstat (limited to 'src/core/url_request_qrc_job_qt.cpp')
-rw-r--r--src/core/url_request_qrc_job_qt.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/core/url_request_qrc_job_qt.cpp b/src/core/url_request_qrc_job_qt.cpp
index d55b940c3..ffe9b6dc6 100644
--- a/src/core/url_request_qrc_job_qt.cpp
+++ b/src/core/url_request_qrc_job_qt.cpp
@@ -89,27 +89,22 @@ bool URLRequestQrcJobQt::GetMimeType(std::string *mimeType) const
return false;
}
-bool URLRequestQrcJobQt::ReadRawData(IOBuffer *buf, int bufSize, int *bytesRead)
+int URLRequestQrcJobQt::ReadRawData(IOBuffer *buf, int bufSize)
{
- DCHECK(bytesRead);
DCHECK_GE(m_remainingBytes, 0);
// File has been read finished.
if (!m_remainingBytes || !bufSize) {
- *bytesRead = 0;
- return true;
+ return 0;
}
if (m_remainingBytes < bufSize)
bufSize = static_cast<int>(m_remainingBytes);
qint64 rv = m_file.read(buf->data(), bufSize);
if (rv >= 0) {
- *bytesRead = static_cast<int>(rv);
m_remainingBytes -= rv;
DCHECK_GE(m_remainingBytes, 0);
- return true;
- } else {
- NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, ERR_FAILED));
+ return static_cast<int>(rv);
}
- return false;
+ return static_cast<int>(rv);
}
void URLRequestQrcJobQt::startGetHead()