Line | Source Code | Coverage |
---|
1 | | - |
2 | | - |
3 | | - |
4 | QNetworkReplyDataImplPrivate::QNetworkReplyDataImplPrivate() | - |
5 | : QNetworkReplyPrivate() | - |
6 | { | - |
7 | } executed: } Execution Count:30 | 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)) { partially evaluated: qDecodeDataUrl(url, mimeType, payload) yes Evaluation Count:30 | no Evaluation Count:0 |
| 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 | } else { executed: } Execution Count:30 | 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 | } | 0 |
52 | } | - |
53 | | - |
54 | void QNetworkReplyDataImpl::close() | - |
55 | { | - |
56 | QNetworkReply::close(); | - |
57 | } | 0 |
58 | | - |
59 | void QNetworkReplyDataImpl::abort() | - |
60 | { | - |
61 | QNetworkReply::close(); | - |
62 | } | 0 |
63 | | - |
64 | qint64 QNetworkReplyDataImpl::bytesAvailable() const | - |
65 | { | - |
66 | const QNetworkReplyDataImplPrivate * const d = d_func(); | - |
67 | return QNetworkReply::bytesAvailable() + d->decodedData.bytesAvailable(); executed: return QNetworkReply::bytesAvailable() + d->decodedData.bytesAvailable(); Execution Count:8 | 8 |
68 | } | - |
69 | | - |
70 | bool QNetworkReplyDataImpl::isSequential () const | - |
71 | { | - |
72 | return true; executed: return true; Execution Count:29 | 29 |
73 | } | - |
74 | | - |
75 | qint64 QNetworkReplyDataImpl::size() const | - |
76 | { | - |
77 | const QNetworkReplyDataImplPrivate * const d = d_func(); | - |
78 | 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 d->decodedData.read(data, maxlen); executed: return d->decodedData.read(data, maxlen); Execution Count:92 | 92 |
93 | } | - |
94 | | - |
95 | | - |
96 | | - |
97 | | - |
98 | | - |
| | |