mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 07:19:05 +02:00
Cleanup BatchLoader
This commit is contained in:
parent
8765329a46
commit
667db200c0
2 changed files with 3 additions and 39 deletions
|
@ -190,7 +190,6 @@ void ResourceCache::requestCompleted(Resource* resource) {
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
if (highestIndex >= 0) {
|
if (highestIndex >= 0) {
|
||||||
qDebug() << "trying to attempt a pending request";
|
|
||||||
attemptRequest(sharedItems->_pendingRequests.takeAt(highestIndex));
|
attemptRequest(sharedItems->_pendingRequests.takeAt(highestIndex));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,47 +50,12 @@ void BatchLoader::start() {
|
||||||
checkFinished();
|
checkFinished();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// If we end up being destroyed before the reply finishes, clean it up
|
||||||
|
connect(this, &QObject::destroyed, request, &QObject::deleteLater);
|
||||||
|
|
||||||
qCDebug(scriptengine) << "Loading script at " << url;
|
qCDebug(scriptengine) << "Loading script at " << url;
|
||||||
|
|
||||||
request->send();
|
request->send();
|
||||||
|
|
||||||
// if (url.scheme() == "http" || url.scheme() == "https" || url.scheme() == "ftp") {
|
|
||||||
// QNetworkRequest request = QNetworkRequest(url);
|
|
||||||
// request.setHeader(QNetworkRequest::UserAgentHeader, HIGH_FIDELITY_USER_AGENT);
|
|
||||||
// QNetworkReply* reply = networkAccessManager.get(request);
|
|
||||||
//
|
|
||||||
// qCDebug(scriptengine) << "Downloading file at" << url;
|
|
||||||
//
|
|
||||||
// connect(reply, &QNetworkReply::finished, [=]() {
|
|
||||||
// if (reply->error()) {
|
|
||||||
// _data.insert(url, QString());
|
|
||||||
// } else {
|
|
||||||
// _data.insert(url, reply->readAll());
|
|
||||||
// }
|
|
||||||
// reply->deleteLater();
|
|
||||||
// checkFinished();
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// // If we end up being destroyed before the reply finishes, clean it up
|
|
||||||
// connect(this, &QObject::destroyed, reply, &QObject::deleteLater);
|
|
||||||
//
|
|
||||||
// } else {
|
|
||||||
// #ifdef _WIN32
|
|
||||||
// QString fileName = url.toString();
|
|
||||||
// #else
|
|
||||||
// QString fileName = url.toLocalFile();
|
|
||||||
// #endif
|
|
||||||
//
|
|
||||||
// qCDebug(scriptengine) << "Reading file at " << fileName;
|
|
||||||
//
|
|
||||||
// QFile scriptFile(fileName);
|
|
||||||
// if (scriptFile.open(QFile::ReadOnly | QFile::Text)) {
|
|
||||||
// QTextStream in(&scriptFile);
|
|
||||||
// _data.insert(url, in.readAll());
|
|
||||||
// } else {
|
|
||||||
// _data.insert(url, QString());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
checkFinished();
|
checkFinished();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue