From b7a47d7bf272be4937df9490308e3f6d3b661bad Mon Sep 17 00:00:00 2001 From: Mark Johnson Date: Sat, 12 Mar 2016 17:35:57 -0800 Subject: [PATCH] Tabs -> Spaces --- interface/src/ui/Stats.cpp | 2 +- interface/src/ui/Stats.h | 4 ++-- libraries/networking/src/ResourceCache.cpp | 26 +++++++++++----------- libraries/networking/src/ResourceCache.h | 12 +++++----- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/interface/src/ui/Stats.cpp b/interface/src/ui/Stats.cpp index 4684862584..23d2b87194 100644 --- a/interface/src/ui/Stats.cpp +++ b/interface/src/ui/Stats.cpp @@ -193,7 +193,7 @@ void Stats::updateStats(bool force) { } STAT_UPDATE(downloads, ResourceCache::getLoadingRequests().size()); - STAT_UPDATE(downloadLimit, ResourceCache::getRequestLimit()) + STAT_UPDATE(downloadLimit, ResourceCache::getRequestLimit()) STAT_UPDATE(downloadsPending, ResourceCache::getPendingRequestCount()); // TODO fix to match original behavior //stringstream downloads; diff --git a/interface/src/ui/Stats.h b/interface/src/ui/Stats.h index 09b9c78637..c6bc13b52c 100644 --- a/interface/src/ui/Stats.h +++ b/interface/src/ui/Stats.h @@ -56,7 +56,7 @@ class Stats : public QQuickItem { STATS_PROPERTY(int, audioMixerKbps, 0) STATS_PROPERTY(int, audioMixerPps, 0) STATS_PROPERTY(int, downloads, 0) - STATS_PROPERTY(int, downloadLimit, 0) + STATS_PROPERTY(int, downloadLimit, 0) STATS_PROPERTY(int, downloadsPending, 0) STATS_PROPERTY(int, triangles, 0) STATS_PROPERTY(int, quads, 0) @@ -136,7 +136,7 @@ signals: void audioMixerKbpsChanged(); void audioMixerPpsChanged(); void downloadsChanged(); - void downloadLimitChanged(); + void downloadLimitChanged(); void downloadsPendingChanged(); void trianglesChanged(); void quadsChanged(); diff --git a/libraries/networking/src/ResourceCache.cpp b/libraries/networking/src/ResourceCache.cpp index 249f22054d..e345bed81c 100644 --- a/libraries/networking/src/ResourceCache.cpp +++ b/libraries/networking/src/ResourceCache.cpp @@ -57,12 +57,12 @@ void ResourceCache::refresh(const QUrl& url) { } void ResourceCache::setRequestLimit(int limit) { - _requestLimit = limit; + _requestLimit = limit; - // Now go fill any new request spots - while (attemptHighestPriorityRequest()) { - // just keep looping until we reach the new limit or no more pending requests - } + // Now go fill any new request spots + while (attemptHighestPriorityRequest()) { + // just keep looping until we reach the new limit or no more pending requests + } } void ResourceCache::getResourceAsynchronously(const QUrl& url) { @@ -175,21 +175,21 @@ bool ResourceCache::attemptRequest(Resource* resource) { sharedItems->_loadingRequests.append(resource); resource->makeRequest(); - return true; + return true; } void ResourceCache::requestCompleted(Resource* resource) { - auto sharedItems = DependencyManager::get(); - sharedItems->_loadingRequests.removeOne(resource); - if (resource->getURL().scheme() != URL_SCHEME_ATP) { - --_requestsActive; - } + auto sharedItems = DependencyManager::get(); + sharedItems->_loadingRequests.removeOne(resource); + if (resource->getURL().scheme() != URL_SCHEME_ATP) { + --_requestsActive; + } - attemptHighestPriorityRequest(); + attemptHighestPriorityRequest(); } bool ResourceCache::attemptHighestPriorityRequest() { - auto sharedItems = DependencyManager::get(); + auto sharedItems = DependencyManager::get(); // look for the highest priority pending request int highestIndex = -1; float highestPriority = -FLT_MAX; diff --git a/libraries/networking/src/ResourceCache.h b/libraries/networking/src/ResourceCache.h index e08d223ad7..a8ab51b7f7 100644 --- a/libraries/networking/src/ResourceCache.h +++ b/libraries/networking/src/ResourceCache.h @@ -67,10 +67,10 @@ class ResourceCache : public QObject { Q_OBJECT public: - static void setRequestLimit(int limit); + static void setRequestLimit(int limit); static int getRequestLimit() { return _requestLimit; } - static int getRequestsActive() { return _requestsActive; } + static int getRequestsActive() { return _requestsActive; } void setUnusedResourceCacheSize(qint64 unusedResourcesMaxSize); qint64 getUnusedResourceCacheSize() const { return _unusedResourcesMaxSize; } @@ -107,11 +107,11 @@ protected: void reserveUnusedResource(qint64 resourceSize); void clearUnusedResource(); - /// 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 + /// 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 Q_INVOKABLE static bool attemptRequest(Resource* resource); static void requestCompleted(Resource* resource); - static bool attemptHighestPriorityRequest(); + static bool attemptHighestPriorityRequest(); private: friend class Resource; @@ -120,7 +120,7 @@ private: int _lastLRUKey = 0; static int _requestLimit; - static int _requestsActive; + static int _requestsActive; void getResourceAsynchronously(const QUrl& url); QReadWriteLock _resourcesToBeGottenLock;