From b30b64c5b567b10f90ff56a4fee94ea2b784ad7a Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Tue, 4 Jun 2013 17:44:19 -0700 Subject: [PATCH] Use downloadProgress rather than isFinished (which worked on files, but didn't on HTTP URLs). --- interface/src/AvatarVoxelSystem.cpp | 6 +++--- interface/src/AvatarVoxelSystem.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/interface/src/AvatarVoxelSystem.cpp b/interface/src/AvatarVoxelSystem.cpp index 2500c9b2d4..d1d463561b 100644 --- a/interface/src/AvatarVoxelSystem.cpp +++ b/interface/src/AvatarVoxelSystem.cpp @@ -88,7 +88,7 @@ void AvatarVoxelSystem::loadVoxelsFromURL(const QUrl& url) { return; } _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())); } @@ -181,9 +181,9 @@ void AvatarVoxelSystem::removeScaleAndReleaseProgram(bool texture) { _skinProgram->disableAttributeArray(_boneWeightsLocation); } -void AvatarVoxelSystem::readVoxelDataFromReply() { +void AvatarVoxelSystem::handleVoxelDownloadProgress(qint64 bytesReceived, qint64 bytesTotal) { // for now, just wait until we have the full business - if (!_voxelReply->isFinished()) { + if (bytesReceived < bytesTotal) { return; } QByteArray entirety = _voxelReply->readAll(); diff --git a/interface/src/AvatarVoxelSystem.h b/interface/src/AvatarVoxelSystem.h index edeeadb17c..3894fd75b9 100644 --- a/interface/src/AvatarVoxelSystem.h +++ b/interface/src/AvatarVoxelSystem.h @@ -46,7 +46,7 @@ protected: private slots: - void readVoxelDataFromReply(); + void handleVoxelDownloadProgress(qint64 bytesReceived, qint64 bytesTotal); void handleVoxelReplyError(); private: