MCPcopy Create free account
hub / github.com/KDAB/GammaRay / replyFinished

Method replyFinished

plugins/network/networkreplymodel.cpp:274–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272}
273
274void 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
303void NetworkReplyModel::replyProgress(QNetworkReply *reply, qint64 progress, qint64 total, QNetworkAccessManager *nam)
304{

Callers

nothing calls this directly

Calls 5

displayStringFunction · 0.85
contentTypeFunction · 0.85
urlMethod · 0.45
errorMethod · 0.45
errorStringMethod · 0.45

Tested by

no test coverage detected