This commit is contained in:
Atlante45 2016-04-14 17:28:24 -07:00
parent 785eda44cd
commit 4ed8573f74
4 changed files with 4 additions and 4 deletions

View file

@ -122,7 +122,7 @@ void DownloadInfoResultFromScriptValue(const QScriptValue& object, DownloadInfoR
DownloadInfoResult GlobalServicesScriptingInterface::getDownloadInfo() { DownloadInfoResult GlobalServicesScriptingInterface::getDownloadInfo() {
DownloadInfoResult result; DownloadInfoResult result;
foreach(auto resource, ResourceCache::getLoadingRequests()) { foreach(const auto& resource, ResourceCache::getLoadingRequests()) {
result.downloading.append(resource->getProgress() * 100.0f); result.downloading.append(resource->getProgress() * 100.0f);
} }
result.pending = ResourceCache::getPendingRequestCount(); result.pending = ResourceCache::getPendingRequestCount();

View file

@ -214,7 +214,7 @@ void Stats::updateStats(bool force) {
// If the urls have changed, update the list // If the urls have changed, update the list
if (shouldUpdateUrls) { if (shouldUpdateUrls) {
_downloadUrls.clear(); _downloadUrls.clear();
foreach (auto resource, loadingRequests) { foreach (const auto& resource, loadingRequests) {
_downloadUrls << resource->getURL().toString(); _downloadUrls << resource->getURL().toString();
} }
emit downloadUrlsChanged(); emit downloadUrlsChanged();

View file

@ -295,7 +295,7 @@ bool ResourceCache::attemptRequest(QSharedPointer<Resource> resource) {
return true; return true;
} }
void ResourceCache::requestCompleted(QSharedPointer<Resource> resource) { void ResourceCache::requestCompleted(QWeakPointer<Resource> resource) {
auto sharedItems = DependencyManager::get<ResourceCacheSharedItems>(); auto sharedItems = DependencyManager::get<ResourceCacheSharedItems>();
sharedItems->removeRequest(resource); sharedItems->removeRequest(resource);
--_requestsActive; --_requestsActive;

View file

@ -141,7 +141,7 @@ protected:
/// Attempt to load a resource if requests are below the limit, otherwise queue the resource for loading /// Attempt to load a resource if requests are below the limit, otherwise queue the resource for loading
/// \return true if the resource began loading, otherwise false if the resource is in the pending queue /// \return true if the resource began loading, otherwise false if the resource is in the pending queue
static bool attemptRequest(QSharedPointer<Resource> resource); static bool attemptRequest(QSharedPointer<Resource> resource);
static void requestCompleted(QSharedPointer<Resource> resource); static void requestCompleted(QWeakPointer<Resource> resource);
static bool attemptHighestPriorityRequest(); static bool attemptHighestPriorityRequest();
private: private: