mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +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;
|
||||
Lock lock(_mutex);
|
||||
|
||||
bool currentHighestIsFile = false;
|
||||
|
||||
for (int i = 0; i < _pendingRequests.size();) {
|
||||
// Clear any freed resources
|
||||
auto resource = _pendingRequests.at(i).lock();
|
||||
|
@ -112,10 +114,12 @@ QSharedPointer<Resource> ResourceCacheSharedItems::getHighestPendingRequest() {
|
|||
|
||||
// Check load priority
|
||||
float priority = resource->getLoadPriority();
|
||||
if (priority >= highestPriority) {
|
||||
bool isFile = resource->getURL().scheme() == URL_SCHEME_FILE;
|
||||
if (priority >= highestPriority && (isFile || !currentHighestIsFile)) {
|
||||
highestPriority = priority;
|
||||
highestIndex = i;
|
||||
highestResource = resource;
|
||||
currentHighestIsFile = isFile;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue