Code Review for Job #19648
Showing the changes to interface/src/Application.cpp (1 of 11 files). Show all
Unified · Split
| @@ -3254,16 +3254,21 @@ ScriptEngine* Application::loadScript(const QString& scriptName, bool loadScript · 3253 unmodified lines | ||
| 3254 | 3254 | return _scriptEnginesHash[scriptName]; |
| 3255 | 3255 | } |
| 3256 | 3256 | |
| 3257 | − // start the script on a new thread... | |
| 3258 | − QUrl scriptUrl(scriptName); | |
| 3259 | − ScriptEngine* scriptEngine = new ScriptEngine(scriptUrl, &_controllerScriptingInterface); | |
| 3260 | − _scriptEnginesHash.insert(scriptUrl.toString(), scriptEngine); | |
| 3261 | − | |
| 3262 | − if (!scriptEngine->hasScript()) { | |
| 3263 | − qDebug() << "Application::loadScript(), script failed to load..."; | |
| 3264 | − return NULL; | |
| 3257 | + ScriptEngine* scriptEngine; | |
| 3258 | + if (scriptName.isNull()) { | |
| 3259 | + scriptEngine = new ScriptEngine(NO_SCRIPT, "", &_controllerScriptingInterface); | |
| 3260 | + } else { | |
| 3261 | + // start the script on a new thread... | |
| 3262 | + QUrl scriptUrl(scriptName); | |
| 3263 | + scriptEngine = new ScriptEngine(scriptUrl, &_controllerScriptingInterface); | |
| 3264 | + _scriptEnginesHash.insert(scriptName, scriptEngine); | |
| 3265 | + | |
| 3266 | + if (!scriptEngine->hasScript()) { | |
| 3267 | + qDebug() << "Application::loadScript(), script failed to load..."; | |
| 3268 | + return NULL; | |
| 3269 | + } | |
| 3270 | + _runningScriptsWidget->setRunningScripts(getRunningScripts()); | |
| 3265 | 3271 | } |
| 3266 | − _runningScriptsWidget->setRunningScripts(getRunningScripts()); | |
| 3267 | 3272 | |
| 3268 | 3273 | // setup the packet senders and jurisdiction listeners of the script engine's scripting interfaces so |
| 3269 | 3274 | // we can use the same ones from the application. |