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
2727 // nothing to do here...
2828 }
2929
30+void ScriptCache::clearCache() {
31+ _scriptCache.clear();
32+}
33+
34+
3035 QString ScriptCache::getScript(const QUrl& unnormalizedURL, ScriptUser* scriptUser, bool& isPending, bool reload) {
3136 QUrl url = ResourceManager::normalizeURL(unnormalizedURL);
3237 QString scriptContents;
@@ -95,6 +100,8 @@ void ScriptCache::getScriptContents(const QString& scriptOrURL, contentAvailable · 62 unmodified lines
95100 return;
96101 }
97102
103+ qCDebug(scriptengine) << "ScriptCache::getScriptContents() scriptOrURL:" << scriptOrURL << " forceDownload:" << forceDownload << " on thread[" << QThread::currentThread() << "] expected thread[" << thread() << "]";
104+
98105 if (_scriptCache.contains(url) && !forceDownload) {
99106 qCDebug(scriptengine) << "Found script in cache:" << url.toString();
100107 #if 1 // def THREAD_DEBUGGING