Showing the changes to libraries/script-engine/src/ScriptCache.cpp (1 of 20 files). Show all
Unified · Split
| @@ -17,7 +17,7 @@ · 16 unmodified lines | ||
| 17 | 17 | |
| 18 | 18 | #include <NetworkAccessManager.h> |
| 19 | 19 | #include <SharedUtil.h> |
| 20 | − | |
| 20 | +#include "ScriptEngineLogging.h" | |
| 21 | 21 | #include "ScriptCache.h" |
| 22 | 22 | |
| 23 | 23 | ScriptCache::ScriptCache(QObject* parent) { |
| @@ -27,7 +27,7 @@ ScriptCache::ScriptCache(QObject* parent) { · 3 unmodified lines | ||
| 27 | 27 | QString ScriptCache::getScript(const QUrl& url, ScriptUser* scriptUser, bool& isPending) { |
| 28 | 28 | QString scriptContents; |
| 29 | 29 | if (_scriptCache.contains(url)) { |
| 30 | − qDebug() << "Found script in cache:" << url.toString(); | |
| 30 | + qCDebug(scriptengine) << "Found script in cache:" << url.toString(); | |
| 31 | 31 | scriptContents = _scriptCache[url]; |
| 32 | 32 | scriptUser->scriptContentsAvailable(url, scriptContents); |
| 33 | 33 | isPending = false; |
| @@ -37,13 +37,13 @@ QString ScriptCache::getScript(const QUrl& url, ScriptUser* scriptUser, bool& is · 3 unmodified lines | ||
| 37 | 37 | _scriptUsers.insert(url, scriptUser); |
| 38 | 38 | |
| 39 | 39 | if (alreadyWaiting) { |
| 40 | − qDebug() << "Already downloading script at:" << url.toString(); | |
| 40 | + qCDebug(scriptengine) << "Already downloading script at:" << url.toString(); | |
| 41 | 41 | } else { |
| 42 | 42 | QNetworkAccessManager& networkAccessManager = NetworkAccessManager::getInstance(); |
| 43 | 43 | QNetworkRequest networkRequest = QNetworkRequest(url); |
| 44 | 44 | networkRequest.setHeader(QNetworkRequest::UserAgentHeader, HIGH_FIDELITY_USER_AGENT); |
| 45 | 45 | |
| 46 | − qDebug() << "Downloading script at:" << url.toString(); | |
| 46 | + qCDebug(scriptengine) << "Downloading script at:" << url.toString(); | |
| 47 | 47 | QNetworkReply* reply = networkAccessManager.get(networkRequest); |
| 48 | 48 | connect(reply, &QNetworkReply::finished, this, &ScriptCache::scriptDownloaded); |
| 49 | 49 | } |
| @@ -59,13 +59,13 @@ void ScriptCache::scriptDownloaded() { · 9 unmodified lines | ||
| 59 | 59 | |
| 60 | 60 | if (reply->error() == QNetworkReply::NoError && reply->attribute(QNetworkRequest::HttpStatusCodeAttribute) == 200) { |
| 61 | 61 | _scriptCache[url] = reply->readAll(); |
| 62 | − qDebug() << "Done downloading script at:" << url.toString(); | |
| 62 | + qCDebug(scriptengine) << "Done downloading script at:" << url.toString(); | |
| 63 | 63 | |
| 64 | 64 | foreach(ScriptUser* user, scriptUsers) { |
| 65 | 65 | user->scriptContentsAvailable(url, _scriptCache[url]); |
| 66 | 66 | } |
| 67 | 67 | } else { |
| 68 | − qDebug() << "ERROR Loading file:" << reply->url().toString(); | |
| 68 | + qCDebug(scriptengine) << "ERROR Loading file:" << reply->url().toString(); | |
| 69 | 69 | foreach(ScriptUser* user, scriptUsers) { |
| 70 | 70 | user->errorInLoadingScript(url); |
| 71 | 71 | } |