mirror of
https://github.com/overte-org/overte.git
synced 2025-06-25 23:29:48 +02:00
Use downloadProgress rather than isFinished (which worked on files, but didn't
on HTTP URLs).
This commit is contained in:
parent
f403fc33f7
commit
b30b64c5b5
2 changed files with 4 additions and 4 deletions
|
@ -88,7 +88,7 @@ void AvatarVoxelSystem::loadVoxelsFromURL(const QUrl& url) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_voxelReply = Application::getInstance()->getNetworkAccessManager()->get(QNetworkRequest(url));
|
_voxelReply = Application::getInstance()->getNetworkAccessManager()->get(QNetworkRequest(url));
|
||||||
connect(_voxelReply, SIGNAL(readyRead()), SLOT(readVoxelDataFromReply()));
|
connect(_voxelReply, SIGNAL(downloadProgress(qint64,qint64)), SLOT(handleVoxelDownloadProgress(qint64,qint64)));
|
||||||
connect(_voxelReply, SIGNAL(error(QNetworkReply::NetworkError)), SLOT(handleVoxelReplyError()));
|
connect(_voxelReply, SIGNAL(error(QNetworkReply::NetworkError)), SLOT(handleVoxelReplyError()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,9 +181,9 @@ void AvatarVoxelSystem::removeScaleAndReleaseProgram(bool texture) {
|
||||||
_skinProgram->disableAttributeArray(_boneWeightsLocation);
|
_skinProgram->disableAttributeArray(_boneWeightsLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AvatarVoxelSystem::readVoxelDataFromReply() {
|
void AvatarVoxelSystem::handleVoxelDownloadProgress(qint64 bytesReceived, qint64 bytesTotal) {
|
||||||
// for now, just wait until we have the full business
|
// for now, just wait until we have the full business
|
||||||
if (!_voxelReply->isFinished()) {
|
if (bytesReceived < bytesTotal) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QByteArray entirety = _voxelReply->readAll();
|
QByteArray entirety = _voxelReply->readAll();
|
||||||
|
|
|
@ -46,7 +46,7 @@ protected:
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
void readVoxelDataFromReply();
|
void handleVoxelDownloadProgress(qint64 bytesReceived, qint64 bytesTotal);
|
||||||
void handleVoxelReplyError();
|
void handleVoxelReplyError();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in a new issue