mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:44:11 +02:00
Tabs -> Spaces
This commit is contained in:
parent
47d3f418e3
commit
b7a47d7bf2
4 changed files with 22 additions and 22 deletions
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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<ResourceCacheSharedItems>();
|
||||
sharedItems->_loadingRequests.removeOne(resource);
|
||||
if (resource->getURL().scheme() != URL_SCHEME_ATP) {
|
||||
--_requestsActive;
|
||||
}
|
||||
auto sharedItems = DependencyManager::get<ResourceCacheSharedItems>();
|
||||
sharedItems->_loadingRequests.removeOne(resource);
|
||||
if (resource->getURL().scheme() != URL_SCHEME_ATP) {
|
||||
--_requestsActive;
|
||||
}
|
||||
|
||||
attemptHighestPriorityRequest();
|
||||
attemptHighestPriorityRequest();
|
||||
}
|
||||
|
||||
bool ResourceCache::attemptHighestPriorityRequest() {
|
||||
auto sharedItems = DependencyManager::get<ResourceCacheSharedItems>();
|
||||
auto sharedItems = DependencyManager::get<ResourceCacheSharedItems>();
|
||||
// look for the highest priority pending request
|
||||
int highestIndex = -1;
|
||||
float highestPriority = -FLT_MAX;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue