Added constant

This commit is contained in:
Atlante45 2015-01-08 17:33:47 -08:00
parent 77e4a2ef35
commit ea832cfd45

View file

@ -73,8 +73,9 @@ QSharedPointer<Resource> ResourceCache::getResource(const QUrl& url, const QUrl&
}
void ResourceCache::addUnusedResource(const QSharedPointer<Resource>& resource) {
static constexpr int BYTES_PER_MEGABYTES = 1024 * 1024;
const int RETAINED_RESOURCE_COUNT = 50;
const int RETAINED_RESOURCE_SIZE = 100 * 1024 * 1024;
const int RETAINED_RESOURCE_SIZE = 100 * BYTES_PER_MEGABYTES;
while (_unusedResourcesTotalBytes + resource->getBytesTotal() > RETAINED_RESOURCE_SIZE &&
!_unusedResources.empty()) {