mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-20 01:08:15 +01:00
[apps/console] Fix the script console fetch status cleaning
unloadPythonEnvironment is not called when leaving the app, only after editing a script, so it did not do what we wanted.
This commit is contained in:
@@ -60,10 +60,6 @@ void ConsoleController::unloadPythonEnvironment() {
|
||||
if (!m_pythonDelegate->isPythonUser(nullptr)) {
|
||||
m_consoleStore.startNewSession();
|
||||
m_pythonDelegate->deinitPython();
|
||||
/* We clean upon unloading and not upon loading, otherwise we break an
|
||||
* assertion in VariableBoxController::loadFunctionsAndVariables, which
|
||||
* checks that the script statuses are clean. */
|
||||
m_scriptStore->clearConsoleFetchInformation();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,6 +195,14 @@ void ConsoleController::didBecomeFirstResponder() {
|
||||
}
|
||||
}
|
||||
|
||||
void ConsoleController::willExitResponderChain(Responder * nextFirstResponder) {
|
||||
ViewController::willExitResponderChain(nextFirstResponder);
|
||||
/* We clean when exiting the responder chain and not when entering it,
|
||||
* otherwise we break an assertion which checks that the script statuses are
|
||||
* clean in VariableBoxController::loadFunctionsAndVariables. */
|
||||
m_scriptStore->clearConsoleFetchInformation();
|
||||
}
|
||||
|
||||
bool ConsoleController::handleEvent(Ion::Events::Event event) {
|
||||
if (event == Ion::Events::OK || event == Ion::Events::EXE) {
|
||||
if (m_consoleStore.numberOfLines() > 0 && m_selectableTableView.selectedRow() < m_consoleStore.numberOfLines()) {
|
||||
|
||||
Reference in New Issue
Block a user