Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 7 files). Show all
Unified · Split
| @@ -280,13 +280,6 @@ void ScriptEngine::loadURL(const QUrl& scriptURL) { · 279 unmodified lines | |||
| 280 | emit errorLoadingScript(_fileNameString); | 280 | emit errorLoadingScript(_fileNameString); |
| 281 | } | 281 | } |
| 282 | } else { | 282 | } else { |
| 283 | /* | ||
| 284 | QNetworkAccessManager& networkAccessManager = NetworkAccessManager::getInstance(); | ||
| 285 | QNetworkRequest networkRequest = QNetworkRequest(url); | ||
| 286 | networkRequest.setHeader(QNetworkRequest::UserAgentHeader, HIGH_FIDELITY_USER_AGENT); | ||
| 287 | QNetworkReply* reply = networkAccessManager.get(networkRequest); | ||
| 288 | connect(reply, &QNetworkReply::finished, this, &ScriptEngine::handleScriptDownload); | ||
| 289 | */ | ||
| 290 | bool isPending; | 283 | bool isPending; |
| 291 | auto scriptCache = DependencyManager::get<ScriptCache>(); | 284 | auto scriptCache = DependencyManager::get<ScriptCache>(); |
| 292 | scriptCache->getScript(url, this, isPending); | 285 | scriptCache->getScript(url, this, isPending); |
| @@ -295,22 +288,6 @@ void ScriptEngine::loadURL(const QUrl& scriptURL) { · 2 unmodified lines | |||
| 295 | } | 288 | } |
| 296 | } | 289 | } |
| 297 | 290 | ||
| 298 | void ScriptEngine::handleScriptDownload() { | ||
| 299 | /* | ||
| 300 | QNetworkReply* reply = qobject_cast<QNetworkReply*>(sender()); | ||
| 301 | |||
| 302 | if (reply->error() == QNetworkReply::NoError && reply->attribute(QNetworkRequest::HttpStatusCodeAttribute) == 200) { | ||
| 303 | _scriptContents = reply->readAll(); | ||
| 304 | emit scriptLoaded(_fileNameString); | ||
| 305 | } else { | ||
| 306 | qDebug() << "ERROR Loading file:" << reply->url().toString(); | ||
| 307 | emit errorLoadingScript(_fileNameString); | ||
| 308 | } | ||
| 309 | |||
| 310 | reply->deleteLater(); | ||
| 311 | */ | ||
| 312 | } | ||
| 313 | |||
| 314 | void ScriptEngine::scriptContentsAvailable(const QUrl& url, const QString& scriptContents) { | 291 | void ScriptEngine::scriptContentsAvailable(const QUrl& url, const QString& scriptContents) { |
| 315 | _scriptContents = scriptContents; | 292 | _scriptContents = scriptContents; |
| 316 | emit scriptLoaded(_fileNameString); | 293 | emit scriptLoaded(_fileNameString); |