This reverts commit 46f2ab73bccf6fa8669856534f0c20f96ee8c416.
Showing the changes to interface/src/Application.cpp (1 of 5 files). Show all
Unified · Split
| @@ -3483,10 +3483,8 @@ void Application::saveScripts() { · 3482 unmodified lines | ||
| 3483 | 3483 | } |
| 3484 | 3484 | |
| 3485 | 3485 | ScriptEngine* Application::loadScript(const QString& scriptName, bool loadScriptFromEditor) { |
| 3486 | − QUrl scriptUrl(scriptName); | |
| 3487 | − const QString& scriptURLString = scriptUrl.toString(); | |
| 3488 | − if(loadScriptFromEditor && _scriptEnginesHash.contains(scriptURLString) && !_scriptEnginesHash[scriptURLString]->isFinished()){ | |
| 3489 | − return _scriptEnginesHash[scriptURLString]; | |
| 3486 | + if(loadScriptFromEditor && _scriptEnginesHash.contains(scriptName) && !_scriptEnginesHash[scriptName]->isFinished()){ | |
| 3487 | + return _scriptEnginesHash[scriptName]; | |
| 3490 | 3488 | } |
| 3491 | 3489 | |
| 3492 | 3490 | ScriptEngine* scriptEngine; |
| @@ -3494,8 +3492,9 @@ ScriptEngine* Application::loadScript(const QString& scriptName, bool loadScript · 1 unmodified line | ||
| 3494 | 3492 | scriptEngine = new ScriptEngine(NO_SCRIPT, "", &_controllerScriptingInterface); |
| 3495 | 3493 | } else { |
| 3496 | 3494 | // start the script on a new thread... |
| 3495 | + QUrl scriptUrl(scriptName); | |
| 3497 | 3496 | scriptEngine = new ScriptEngine(scriptUrl, &_controllerScriptingInterface); |
| 3498 | − _scriptEnginesHash.insert(scriptURLString, scriptEngine); | |
| 3497 | + _scriptEnginesHash.insert(scriptUrl.toString(), scriptEngine); | |
| 3499 | 3498 | |
| 3500 | 3499 | if (!scriptEngine->hasScript()) { |
| 3501 | 3500 | qDebug() << "Application::loadScript(), script failed to load..."; |