mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 16:30:39 +02:00
set file url as higher priority
This commit is contained in:
parent
b35d696077
commit
68fa426da9
1 changed files with 5 additions and 1 deletions
|
@ -102,6 +102,8 @@ QSharedPointer<Resource> ResourceCacheSharedItems::getHighestPendingRequest() {
|
||||||
QSharedPointer<Resource> highestResource;
|
QSharedPointer<Resource> highestResource;
|
||||||
Lock lock(_mutex);
|
Lock lock(_mutex);
|
||||||
|
|
||||||
|
bool currentHighestIsFile = false;
|
||||||
|
|
||||||
for (int i = 0; i < _pendingRequests.size();) {
|
for (int i = 0; i < _pendingRequests.size();) {
|
||||||
// Clear any freed resources
|
// Clear any freed resources
|
||||||
auto resource = _pendingRequests.at(i).lock();
|
auto resource = _pendingRequests.at(i).lock();
|
||||||
|
@ -112,10 +114,12 @@ QSharedPointer<Resource> ResourceCacheSharedItems::getHighestPendingRequest() {
|
||||||
|
|
||||||
// Check load priority
|
// Check load priority
|
||||||
float priority = resource->getLoadPriority();
|
float priority = resource->getLoadPriority();
|
||||||
if (priority >= highestPriority) {
|
bool isFile = resource->getURL().scheme() == URL_SCHEME_FILE;
|
||||||
|
if (priority >= highestPriority && (isFile || !currentHighestIsFile)) {
|
||||||
highestPriority = priority;
|
highestPriority = priority;
|
||||||
highestIndex = i;
|
highestIndex = i;
|
||||||
highestResource = resource;
|
highestResource = resource;
|
||||||
|
currentHighestIsFile = isFile;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue