History

changes per CR

humbletim committed 6 years ago

Commit f41ef311 parent a7fb2941 file · +8 −8Browse files

Showing the changes to libraries/script-engine/src/ScriptCache.cpp (1 of 1 file). Show all

Unified · Split

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