Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/network/access/qnetworkreplydataimpl.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | QNetworkReplyDataImplPrivate::QNetworkReplyDataImplPrivate() | - | ||||||
5 | : QNetworkReplyPrivate() | - | ||||||
6 | { | - | ||||||
7 | } executed 30 times by 1 test: end of block Executed by:
| 30 | ||||||
8 | - | |||||||
9 | QNetworkReplyDataImplPrivate::~QNetworkReplyDataImplPrivate() | - | ||||||
10 | { | - | ||||||
11 | } | - | ||||||
12 | - | |||||||
13 | QNetworkReplyDataImpl::~QNetworkReplyDataImpl() | - | ||||||
14 | { | - | ||||||
15 | } | - | ||||||
16 | - | |||||||
17 | QNetworkReplyDataImpl::QNetworkReplyDataImpl(QObject *parent, const QNetworkRequest &req, const QNetworkAccessManager::Operation op) | - | ||||||
18 | : QNetworkReply(*new QNetworkReplyDataImplPrivate(), parent) | - | ||||||
19 | { | - | ||||||
20 | QNetworkReplyDataImplPrivate * const d = d_func(); | - | ||||||
21 | setRequest(req); | - | ||||||
22 | setUrl(req.url()); | - | ||||||
23 | setOperation(op); | - | ||||||
24 | setFinished(true); | - | ||||||
25 | QNetworkReply::open(QIODevice::ReadOnly); | - | ||||||
26 | - | |||||||
27 | QUrl url = req.url(); | - | ||||||
28 | QString mimeType; | - | ||||||
29 | QByteArray payload; | - | ||||||
30 | if (qDecodeDataUrl(url, mimeType, payload)
| 0-30 | ||||||
31 | qint64 size = payload.size(); | - | ||||||
32 | setHeader(QNetworkRequest::ContentTypeHeader, mimeType); | - | ||||||
33 | setHeader(QNetworkRequest::ContentLengthHeader, size); | - | ||||||
34 | QMetaObject::invokeMethod(this, "metaDataChanged", Qt::QueuedConnection); | - | ||||||
35 | - | |||||||
36 | d->decodedData.setData(payload); | - | ||||||
37 | d->decodedData.open(QIODevice::ReadOnly); | - | ||||||
38 | - | |||||||
39 | QMetaObject::invokeMethod(this, "downloadProgress", Qt::QueuedConnection, | - | ||||||
40 | QArgument<qint64 >("qint64", size), QArgument<qint64 >("qint64", size)); | - | ||||||
41 | QMetaObject::invokeMethod(this, "readyRead", Qt::QueuedConnection); | - | ||||||
42 | QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection); | - | ||||||
43 | } executed 30 times by 1 test: else {end of block Executed by:
| 30 | ||||||
44 | - | |||||||
45 | const QString msg = QCoreApplication::translate("QNetworkAccessDataBackend", | - | ||||||
46 | "Invalid URI: %1").arg(url.toString()); | - | ||||||
47 | setError(QNetworkReply::ProtocolFailure, msg); | - | ||||||
48 | QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection, | - | ||||||
49 | QArgument<QNetworkReply::NetworkError >("QNetworkReply::NetworkError", QNetworkReply::ProtocolFailure)); | - | ||||||
50 | QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection); | - | ||||||
51 | } never executed: end of block | 0 | ||||||
52 | } | - | ||||||
53 | - | |||||||
54 | void QNetworkReplyDataImpl::close() | - | ||||||
55 | { | - | ||||||
56 | QNetworkReply::close(); | - | ||||||
57 | } never executed: end of block | 0 | ||||||
58 | - | |||||||
59 | void QNetworkReplyDataImpl::abort() | - | ||||||
60 | { | - | ||||||
61 | QNetworkReply::close(); | - | ||||||
62 | } never executed: end of block | 0 | ||||||
63 | - | |||||||
64 | qint64 QNetworkReplyDataImpl::bytesAvailable() const | - | ||||||
65 | { | - | ||||||
66 | const QNetworkReplyDataImplPrivate * const d = d_func(); | - | ||||||
67 | return executed 8 times by 1 test: QNetworkReply::bytesAvailable() + d->decodedData.bytesAvailable();return QNetworkReply::bytesAvailable() + d->decodedData.bytesAvailable(); Executed by:
executed 8 times by 1 test: return QNetworkReply::bytesAvailable() + d->decodedData.bytesAvailable(); Executed by:
| 8 | ||||||
68 | } | - | ||||||
69 | - | |||||||
70 | bool QNetworkReplyDataImpl::isSequential () const | - | ||||||
71 | { | - | ||||||
72 | return executed 29 times by 1 test: true;return true; Executed by:
executed 29 times by 1 test: return true; Executed by:
| 29 | ||||||
73 | } | - | ||||||
74 | - | |||||||
75 | qint64 QNetworkReplyDataImpl::size() const | - | ||||||
76 | { | - | ||||||
77 | const QNetworkReplyDataImplPrivate * const d = d_func(); | - | ||||||
78 | return never executed: d->decodedData.size();return d->decodedData.size(); never executed: return d->decodedData.size(); | 0 | ||||||
79 | } | - | ||||||
80 | - | |||||||
81 | - | |||||||
82 | - | |||||||
83 | - | |||||||
84 | qint64 QNetworkReplyDataImpl::readData(char *data, qint64 maxlen) | - | ||||||
85 | { | - | ||||||
86 | QNetworkReplyDataImplPrivate * const d = d_func(); | - | ||||||
87 | - | |||||||
88 | - | |||||||
89 | - | |||||||
90 | - | |||||||
91 | - | |||||||
92 | return executed 47 times by 1 test: d->decodedData.read(data, maxlen);return d->decodedData.read(data, maxlen); Executed by:
executed 47 times by 1 test: return d->decodedData.read(data, maxlen); Executed by:
| 47 | ||||||
93 | } | - | ||||||
94 | - | |||||||
95 | - | |||||||
96 | - | |||||||
97 | - | |||||||
Switch to Source code | Preprocessed file |