mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 14:47:19 +02:00
Change Resource setBytes->setSize
This commit is contained in:
parent
f34e951c3f
commit
107cfcf10b
3 changed files with 4 additions and 4 deletions
|
@ -338,7 +338,7 @@ void NetworkTexture::setImage(void* voidTexture, int originalWidth,
|
|||
if (gpuTexture) {
|
||||
_width = gpuTexture->getWidth();
|
||||
_height = gpuTexture->getHeight();
|
||||
setBytes(gpuTexture->getStoredSize());
|
||||
setSize(gpuTexture->getStoredSize());
|
||||
} else {
|
||||
// FIXME: If !gpuTexture, we failed to load!
|
||||
_width = _height = 0;
|
||||
|
|
|
@ -416,7 +416,7 @@ void Resource::finishedLoading(bool success) {
|
|||
emit finished(success);
|
||||
}
|
||||
|
||||
void Resource::setBytes(const qint64& bytes) {
|
||||
void Resource::setSize(const qint64& bytes) {
|
||||
QMetaObject::invokeMethod(_cache.data(), "updateTotalSize", Q_ARG(qint64, _bytes), Q_ARG(qint64, bytes));
|
||||
_bytes = bytes;
|
||||
}
|
||||
|
@ -456,7 +456,7 @@ void Resource::handleDownloadProgress(uint64_t bytesReceived, uint64_t bytesTota
|
|||
void Resource::handleReplyFinished() {
|
||||
Q_ASSERT_X(_request, "Resource::handleReplyFinished", "Request should not be null while in handleReplyFinished");
|
||||
|
||||
setBytes(_bytesTotal);
|
||||
setSize(_bytesTotal);
|
||||
|
||||
if (!_request || _request != sender()) {
|
||||
// This can happen in the edge case that a request is timed out, but a `finished` signal is emitted before it is deleted.
|
||||
|
|
|
@ -255,7 +255,7 @@ protected:
|
|||
virtual void downloadFinished(const QByteArray& data) { finishedLoading(true); }
|
||||
|
||||
/// Called when the download is finished and processed, sets the number of actual bytes.
|
||||
void setBytes(const qint64& bytes);
|
||||
void setSize(const qint64& bytes);
|
||||
|
||||
/// Called when the download is finished and processed.
|
||||
/// This should be called by subclasses that override downloadFinished to mark the end of processing.
|
||||
|
|
Loading…
Reference in a new issue