[apps/code] Fix variables loading in the console

Scenario: execute a script, open the variable box, select a leaf, reopen
the variable box -> it shows empty
This commit is contained in:
Léa Saviot
2020-06-19 12:08:48 +02:00
parent cf4eaa3d1f
commit 1045f54633
3 changed files with 6 additions and 13 deletions

View File

@@ -177,10 +177,11 @@ void VariableBoxController::loadFunctionsAndVariables(int scriptIndex, const cha
Script script = m_scriptStore->scriptAtIndex(scriptIndex);
assert(!script.isNull());
/* Handle the FetchedStatus: we will import the current script variables in
* loadCurrentVariablesInScript, so we do not want to import those variables
* before, if any imported script also imported the current script. */
assert(!script.fetchedFromConsole() && !script.fetchedForVariableBox());
/* Handle the fetchedForVariableBox status: we will import the current script
* variables in loadCurrentVariablesInScript, so we do not want to import
* those variables before, if any imported script also imported the current
* script. */
assert(!script.fetchedForVariableBox());
script.setFetchedForVariableBox(true);
// Load the imported and current variables