Keep the scriptUrl internal to the ScriptEngine class and refer to it externally by the file name string. Change the ScriptEngine constructor to accept a filename QString, instead of a QUrl. Resolve constructor ambiguity in Particle, which creates anonymous ScriptEngine.
Showing the changes to interface/src/Application.cpp (1 of 4 files). Show all
Unified · Split
| @@ -3492,9 +3492,8 @@ ScriptEngine* Application::loadScript(const QString& scriptName, bool loadScript · 3491 unmodified lines | |||
| 3492 | scriptEngine = new ScriptEngine(NO_SCRIPT, "", &_controllerScriptingInterface); | 3492 | scriptEngine = new ScriptEngine(NO_SCRIPT, "", &_controllerScriptingInterface); |
| 3493 | } else { | 3493 | } else { |
| 3494 | // start the script on a new thread... | 3494 | // start the script on a new thread... |
| 3495 | QUrl scriptUrl(scriptName); | 3495 | scriptEngine = new ScriptEngine(scriptName, &_controllerScriptingInterface); |
| 3496 | scriptEngine = new ScriptEngine(scriptUrl, &_controllerScriptingInterface); | 3496 | _scriptEnginesHash.insert(scriptName, scriptEngine); |
| 3497 | _scriptEnginesHash.insert(scriptUrl.toString(), scriptEngine); | ||
| 3498 | 3497 | ||
| 3499 | if (!scriptEngine->hasScript()) { | 3498 | if (!scriptEngine->hasScript()) { |
| 3500 | qDebug() << "Application::loadScript(), script failed to load..."; | 3499 | qDebug() << "Application::loadScript(), script failed to load..."; |