From f713551d46d8690e292d2d4e03e1d5bcdfe93dfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Tue, 12 Mar 2019 14:43:18 +0100 Subject: [PATCH] [code] Get rid of unused member variable in VariableBoxController --- apps/code/app.cpp | 2 +- apps/code/variable_box_controller.cpp | 5 ++--- apps/code/variable_box_controller.h | 5 +---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/apps/code/app.cpp b/apps/code/app.cpp index f3f368a8a..a640ded5a 100644 --- a/apps/code/app.cpp +++ b/apps/code/app.cpp @@ -84,7 +84,7 @@ App::App(Container * container, Snapshot * snapshot) : m_listFooter(&m_codeStackViewController, &m_menuController, &m_menuController, ButtonRowController::Position::Bottom, ButtonRowController::Style::EmbossedGrey, ButtonRowController::Size::Large), m_menuController(&m_listFooter, this, snapshot->scriptStore(), &m_listFooter), m_codeStackViewController(&m_modalViewController, &m_listFooter), - m_variableBoxController(this, snapshot->scriptStore()) + m_variableBoxController(snapshot->scriptStore()) { } diff --git a/apps/code/variable_box_controller.cpp b/apps/code/variable_box_controller.cpp index 674b4f445..13f086a57 100644 --- a/apps/code/variable_box_controller.cpp +++ b/apps/code/variable_box_controller.cpp @@ -11,9 +11,8 @@ namespace Code { -VariableBoxController::VariableBoxController(App * pythonDelegate, ScriptStore * scriptStore) : +VariableBoxController::VariableBoxController(ScriptStore * scriptStore) : NestedMenuController(nullptr, I18n::Message::FunctionsAndVariables), - m_pythonDelegate(pythonDelegate), m_scriptNodesCount(0), m_scriptStore(scriptStore) { @@ -34,7 +33,7 @@ void VariableBoxController::didEnterResponderChain(Responder * previousFirstResp * environment where Python has already been inited. This way, we do not * deinit Python when leaving the VariableBoxController, so we do not lose the * environment that was loaded when entering the VariableBoxController. */ - assert(m_pythonDelegate->pythonIsInited()); + assert(static_cast(app())->pythonIsInited()); } static bool shouldAddObject(const char * name, int maxLength) { diff --git a/apps/code/variable_box_controller.h b/apps/code/variable_box_controller.h index 046ad33bc..6e1047126 100644 --- a/apps/code/variable_box_controller.h +++ b/apps/code/variable_box_controller.h @@ -8,11 +8,9 @@ namespace Code { -class App; - class VariableBoxController : public NestedMenuController { public: - VariableBoxController(App * pythonDelegate, ScriptStore * scriptStore); + VariableBoxController(ScriptStore * scriptStore); /* Responder */ bool handleEvent(Ion::Events::Event event) override; @@ -36,7 +34,6 @@ private: void insertTextInCaller(const char * text); void addFunctionAtIndex(const char * functionName, int scriptIndex); void addVariableAtIndex(const char * variableName, int scriptIndex); - App * m_pythonDelegate; ScriptNode m_scriptNodes[k_maxScriptNodesCount]; int m_scriptNodesCount; ScriptStore * m_scriptStore;