Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Added fromCache attribute to network response #12090

Merged
2 commits merged into from
Jan 8, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/networkaccessmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ void NetworkAccessManager::handleStarted()
data["redirectURL"] = reply->header(QNetworkRequest::LocationHeader);
data["headers"] = headers;
data["time"] = QDateTime::currentDateTime();
data["fromCache"] = reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool();

emit resourceReceived(data);
}
Expand Down Expand Up @@ -376,6 +377,7 @@ void NetworkAccessManager::handleFinished(QNetworkReply *reply, const QVariant &
data["redirectURL"] = reply->header(QNetworkRequest::LocationHeader);
data["headers"] = headers;
data["time"] = QDateTime::currentDateTime();
data["fromCache"] = reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool();

m_ids.remove(reply);
m_started.remove(reply);
Expand Down