mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 13:33:38 +02:00
Merge pull request #7474 from zzmp/fix/drop-network-data
Drop network data after processing
This commit is contained in:
commit
4893d1f09e
6 changed files with 10 additions and 12 deletions
|
@ -611,7 +611,7 @@ AnimNode::Pointer AnimNodeLoader::load(const QByteArray& contents, const QUrl& j
|
|||
return loadNode(rootVal.toObject(), jsonUrl);
|
||||
}
|
||||
|
||||
void AnimNodeLoader::onRequestDone(const QByteArray& data) {
|
||||
void AnimNodeLoader::onRequestDone(const QByteArray data) {
|
||||
auto node = load(data, _url);
|
||||
if (node) {
|
||||
emit success(node);
|
||||
|
|
|
@ -36,7 +36,7 @@ protected:
|
|||
static AnimNode::Pointer load(const QByteArray& contents, const QUrl& jsonUrl);
|
||||
|
||||
protected slots:
|
||||
void onRequestDone(const QByteArray& data);
|
||||
void onRequestDone(const QByteArray data);
|
||||
void onRequestError(QNetworkReply::NetworkError error);
|
||||
|
||||
protected:
|
||||
|
|
|
@ -293,7 +293,7 @@ void NetworkGeometry::requestModel(const QUrl& url) {
|
|||
connect(_resource, &Resource::failed, this, &NetworkGeometry::modelRequestError);
|
||||
}
|
||||
|
||||
void NetworkGeometry::mappingRequestDone(const QByteArray& data) {
|
||||
void NetworkGeometry::mappingRequestDone(const QByteArray data) {
|
||||
assert(_state == RequestMappingState);
|
||||
|
||||
// parse the mapping file
|
||||
|
@ -325,7 +325,7 @@ void NetworkGeometry::mappingRequestError(QNetworkReply::NetworkError error) {
|
|||
emit onFailure(*this, MappingRequestError);
|
||||
}
|
||||
|
||||
void NetworkGeometry::modelRequestDone(const QByteArray& data) {
|
||||
void NetworkGeometry::modelRequestDone(const QByteArray data) {
|
||||
assert(_state == RequestModelState);
|
||||
|
||||
_state = ParsingModelState;
|
||||
|
|
|
@ -113,10 +113,10 @@ public slots:
|
|||
void textureLoaded(const QWeakPointer<NetworkTexture>& networkTexture);
|
||||
|
||||
protected slots:
|
||||
void mappingRequestDone(const QByteArray& data);
|
||||
void mappingRequestDone(const QByteArray data);
|
||||
void mappingRequestError(QNetworkReply::NetworkError error);
|
||||
|
||||
void modelRequestDone(const QByteArray& data);
|
||||
void modelRequestDone(const QByteArray data);
|
||||
void modelRequestError(QNetworkReply::NetworkError error);
|
||||
|
||||
void modelParseSuccess(FBXGeometry* geometry);
|
||||
|
|
|
@ -423,12 +423,12 @@ void Resource::handleReplyFinished() {
|
|||
|
||||
auto result = _request->getResult();
|
||||
if (result == ResourceRequest::Success) {
|
||||
_data = _request->getData();
|
||||
auto extraInfo = _url == _activeUrl ? "" : QString(", %1").arg(_activeUrl.toDisplayString());
|
||||
qCDebug(networking).noquote() << QString("Request finished for %1%2").arg(_url.toDisplayString(), extraInfo);
|
||||
|
||||
emit loaded(_data);
|
||||
downloadFinished(_data);
|
||||
auto data = _request->getData();
|
||||
emit loaded(data);
|
||||
downloadFinished(data);
|
||||
} else {
|
||||
switch (result) {
|
||||
case ResourceRequest::Result::Timeout: {
|
||||
|
|
|
@ -194,12 +194,11 @@ public:
|
|||
Q_INVOKABLE void allReferencesCleared();
|
||||
|
||||
const QUrl& getURL() const { return _url; }
|
||||
const QByteArray& getData() const { return _data; }
|
||||
|
||||
signals:
|
||||
/// Fired when the resource has been downloaded.
|
||||
/// This can be used instead of downloadFinished to access data before it is processed.
|
||||
void loaded(const QByteArray& request);
|
||||
void loaded(const QByteArray request);
|
||||
|
||||
/// Fired when the resource has finished loading.
|
||||
void finished(bool success);
|
||||
|
@ -235,7 +234,6 @@ protected:
|
|||
QHash<QPointer<QObject>, float> _loadPriorities;
|
||||
QWeakPointer<Resource> _self;
|
||||
QPointer<ResourceCache> _cache;
|
||||
QByteArray _data;
|
||||
|
||||
private slots:
|
||||
void handleDownloadProgress(uint64_t bytesReceived, uint64_t bytesTotal);
|
||||
|
|
Loading…
Reference in a new issue