mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 19:16:56 +02:00
Merge pull request #1068 from daleglass/fix_resource_totals
Set resource total size to content size when using a qrc:// resource
This commit is contained in:
commit
5e2cc4c4bf
1 changed files with 8 additions and 2 deletions
|
@ -794,8 +794,6 @@ void Resource::handleReplyFinished() {
|
||||||
{ "size_mb", _bytesTotal / 1000000.0 }
|
{ "size_mb", _bytesTotal / 1000000.0 }
|
||||||
});
|
});
|
||||||
|
|
||||||
setSize(_bytesTotal);
|
|
||||||
|
|
||||||
// Make sure we keep the Resource alive here
|
// Make sure we keep the Resource alive here
|
||||||
auto self = _self.lock();
|
auto self = _self.lock();
|
||||||
ResourceCache::requestCompleted(_self);
|
ResourceCache::requestCompleted(_self);
|
||||||
|
@ -809,6 +807,14 @@ void Resource::handleReplyFinished() {
|
||||||
}
|
}
|
||||||
|
|
||||||
auto data = _request->getData();
|
auto data = _request->getData();
|
||||||
|
if (_request->getUrl().scheme() == "qrc") {
|
||||||
|
// For resources under qrc://, there's no actual download being done, so
|
||||||
|
// handleDownloadProgress never gets called. We get the full length here
|
||||||
|
// at the end.
|
||||||
|
_bytesTotal = data.length();
|
||||||
|
}
|
||||||
|
|
||||||
|
setSize(_bytesTotal);
|
||||||
emit loaded(data);
|
emit loaded(data);
|
||||||
downloadFinished(data);
|
downloadFinished(data);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue