History

normalize how ScriptCache::getScript() works relative to ResourceManager

Brad Hefta-Gaub committed 11 years ago

Commit 8395fb61 parent f85cb2c5 files · +28 −47Browse files

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

Unified · Split

libraries/script-engine/src/ScriptCache.cpp+4−2
@@ -26,7 +26,8 @@ ScriptCache::ScriptCache(QObject* parent) { · 25 unmodified lines
2626 // nothing to do here...
2727 }
2828
29−QString ScriptCache::getScript(const QUrl& url, ScriptUser* scriptUser, bool& isPending, bool reload) {
29+QString ScriptCache::getScript(const QUrl& unnormalizedURL, ScriptUser* scriptUser, bool& isPending, bool reload) {
30+ QUrl url = ResourceManager::normalizeURL(unnormalizedURL);
3031 QString scriptContents;
3132 if (_scriptCache.contains(url) && !reload) {
3233 qCDebug(scriptengine) << "Found script in cache:" << url.toString();
@@ -50,7 +51,8 @@ QString ScriptCache::getScript(const QUrl& url, ScriptUser* scriptUser, bool& is · 17 unmodified lines
5051 return scriptContents;
5152 }
5253
53−void ScriptCache::deleteScript(const QUrl& url) {
54+void ScriptCache::deleteScript(const QUrl& unnormalizedURL) {
55+ QUrl url = ResourceManager::normalizeURL(unnormalizedURL);
5456 if (_scriptCache.contains(url)) {
5557 qCDebug(scriptengine) << "Delete script from cache:" << url.toString();
5658 _scriptCache.remove(url);