Showing the changes to libraries/script-engine/src/ScriptCache.cpp (1 of 1 file). Show all
Unified · Split
| @@ -87,8 +87,8 @@ void ScriptCache::getScriptContents(const QString& scriptOrURL, contentAvailable · 86 unmodified lines | ||
| 87 | 87 | if (_scriptCache.contains(url) && !forceDownload) { |
| 88 | 88 | auto entry = _scriptCache[url]; |
| 89 | 89 | if (url.isLocalFile() || url.scheme().isEmpty()) { |
| 90 | − auto mtime = QFileInfo(url.toLocalFile()).lastModified(); | |
| 91 | − QString localTime = ResourceRequest::toHttpDateString(mtime.toMSecsSinceEpoch()); | |
| 90 | + auto modifiedTime = QFileInfo(url.toLocalFile()).lastModified(); | |
| 91 | + QString localTime = ResourceRequest::toHttpDateString(modifiedTime.toMSecsSinceEpoch()); | |
| 92 | 92 | QString cachedTime = entry["last-modified"].toString(); |
| 93 | 93 | if (cachedTime != localTime) { |
| 94 | 94 | forceDownload = true; |
| @@ -97,10 +97,10 @@ void ScriptCache::getScriptContents(const QString& scriptOrURL, contentAvailable · 2 unmodified lines | ||
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | if (!forceDownload) { |
| 100 | − lock.unlock(); | |
| 101 | − qCDebug(scriptengine) << "Found script in cache:" << url.fileName(); | |
| 102 | − contentAvailable(url.toString(), entry["data"].toString(), true, true, STATUS_CACHED); | |
| 103 | − return; | |
| 100 | + lock.unlock(); | |
| 101 | + qCDebug(scriptengine) << "Found script in cache:" << url.fileName(); | |
| 102 | + contentAvailable(url.toString(), entry["data"].toString(), true, true, STATUS_CACHED); | |
| 103 | + return; | |
| 104 | 104 | } |
| 105 | 105 | } |
| 106 | 106 | { |
| @@ -155,8 +155,8 @@ void ScriptCache::scriptContentAvailable(int maxRetries) { · 48 unmodified lines | ||
| 155 | 155 | _activeScriptRequests.remove(url); |
| 156 | 156 | |
| 157 | 157 | _scriptCache[url] = { |
| 158 | − { "data", scriptContent = req->getData() }, | |
| 159 | − { "last-modified", req->property("last-modified") }, | |
| 158 | + { "data", scriptContent = req->getData() }, | |
| 159 | + { "last-modified", req->property("last-modified") }, | |
| 160 | 160 | }; |
| 161 | 161 | } else { |
| 162 | 162 | auto result = req->getResult(); |