History

add reload all support for entity scripts

Brad Hefta-Gaub committed 11 years ago

Commit 7840f121 parent 009633f7 files · +30 −3Browse files

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

Unified · Split

libraries/script-engine/src/ScriptCache.cpp+7−0
@@ -27,6 +27,11 @@ ScriptCache::ScriptCache(QObject* parent) { · 26 unmodified lines
27 // nothing to do here...27 // nothing to do here...
28}28}
29 29
30void ScriptCache::clearCache() {
31 _scriptCache.clear();
32}
33
34
30QString ScriptCache::getScript(const QUrl& unnormalizedURL, ScriptUser* scriptUser, bool& isPending, bool reload) {35QString ScriptCache::getScript(const QUrl& unnormalizedURL, ScriptUser* scriptUser, bool& isPending, bool reload) {
31 QUrl url = ResourceManager::normalizeURL(unnormalizedURL);36 QUrl url = ResourceManager::normalizeURL(unnormalizedURL);
32 QString scriptContents;37 QString scriptContents;
@@ -95,6 +100,8 @@ void ScriptCache::getScriptContents(const QString& scriptOrURL, contentAvailable · 62 unmodified lines
95 return;100 return;
96 }101 }
97 102
103 qCDebug(scriptengine) << "ScriptCache::getScriptContents() scriptOrURL:" << scriptOrURL << " forceDownload:" << forceDownload << " on thread[" << QThread::currentThread() << "] expected thread[" << thread() << "]";
104
98 if (_scriptCache.contains(url) && !forceDownload) {105 if (_scriptCache.contains(url) && !forceDownload) {
99 qCDebug(scriptengine) << "Found script in cache:" << url.toString();106 qCDebug(scriptengine) << "Found script in cache:" << url.toString();
100 #if 1 // def THREAD_DEBUGGING107 #if 1 // def THREAD_DEBUGGING