| 272 | } |
| 273 | |
| 274 | void NetworkReplyModel::replyFinished(QNetworkReply *reply, QNetworkAccessManager *nam) |
| 275 | { |
| 276 | /// WARNING this runs in the thread of the reply, not the thread of this! |
| 277 | ReplyNode node; |
| 278 | node.reply = reply; |
| 279 | node.displayName = Util::displayString(reply); |
| 280 | node.url = reply->url(); |
| 281 | node.op = reply->operation(); |
| 282 | node.state |= NetworkReply::Finished; |
| 283 | node.duration = m_time.elapsed() - node.duration; |
| 284 | node.contentType = contentType(reply->header(QNetworkRequest::ContentTypeHeader)); |
| 285 | |
| 286 | maybePeekResponse(node, reply); |
| 287 | |
| 288 | if (reply->error() != QNetworkReply::NoError) { |
| 289 | node.state |= NetworkReply::Error; |
| 290 | node.errorMsgs.push_back(reply->errorString()); |
| 291 | } |
| 292 | |
| 293 | // clang-format off |
| 294 | QMetaObject::invokeMethod(this, "updateReplyNode", Qt::AutoConnection, Q_ARG(QNetworkAccessManager*, nam), Q_ARG(GammaRay::NetworkReplyModel::ReplyNode, node)); |
| 295 | // clang-format on |
| 296 | |
| 297 | if (reply->thread() != thread()) { |
| 298 | connect( |
| 299 | reply, &QNetworkReply::destroyed, this, [this, reply, nam]() { replyDeleted(reply, nam); }, Qt::DirectConnection); |
| 300 | } |
| 301 | } |
| 302 | |
| 303 | void NetworkReplyModel::replyProgress(QNetworkReply *reply, qint64 progress, qint64 total, QNetworkAccessManager *nam) |
| 304 | { |
nothing calls this directly
no test coverage detected