[apps/code] Fix script importation status

Scenario: Execute the script parabola.py, open the variable box, select
any leaf, enter, open the variable box again -> no variables are loaded
anymore
This commit is contained in:
Léa Saviot
2020-06-09 15:12:13 +02:00
parent 213d3d322d
commit 1ccb55a16e
7 changed files with 67 additions and 71 deletions

View File

@@ -31,16 +31,24 @@ const char * ScriptStore::contentOfScript(const char * name, bool markAsFetched)
return nullptr;
}
if (markAsFetched) {
script.setContentFetchedFromConsole();
script.setFetchedFromConsole(true);
}
return script.content();
}
void ScriptStore::clearFetchInformation() {
void ScriptStore::clearVariableBoxFetchInformation() {
// TODO optimize fetches
const int scriptsCount = numberOfScripts();
for (int i = 0; i < scriptsCount; i++) {
scriptAtIndex(i).resetContentFetchedStatus();
scriptAtIndex(i).setFetchedForVariableBox(false);
}
}
void ScriptStore::clearConsoleFetchInformation() {
// TODO optimize fetches
const int scriptsCount = numberOfScripts();
for (int i = 0; i < scriptsCount; i++) {
scriptAtIndex(i).setFetchedFromConsole(false);
}
}