From 68867e45e7e7d63c6a464d968e145b4903f38e4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Thu, 30 Apr 2020 16:26:36 +0200 Subject: [PATCH] [apps] Factorize isDisplayingEmptyController Because we can now, it might need to be de-factorized later, if more classes inherit from alternate_empty_nested_menu_controller --- apps/alternate_empty_nested_menu_controller.h | 2 +- apps/code/variable_box_controller.h | 1 - apps/math_variable_box_controller.h | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/alternate_empty_nested_menu_controller.h b/apps/alternate_empty_nested_menu_controller.h index 3397cf66d..d310b15b6 100644 --- a/apps/alternate_empty_nested_menu_controller.h +++ b/apps/alternate_empty_nested_menu_controller.h @@ -12,7 +12,7 @@ public: void viewDidDisappear() override; protected: virtual ViewController * emptyViewController() = 0; - virtual bool isDisplayingEmptyController() = 0; + bool isDisplayingEmptyController() { return StackViewController::depth() == 2; } bool displayEmptyControllerIfNeeded(); }; diff --git a/apps/code/variable_box_controller.h b/apps/code/variable_box_controller.h index 0537c7f62..18a2bf4ca 100644 --- a/apps/code/variable_box_controller.h +++ b/apps/code/variable_box_controller.h @@ -32,7 +32,6 @@ public: //AlternateEmptyNestedMenuController ViewController * emptyViewController() override { return &m_variableBoxEmptyController; } - bool isDisplayingEmptyController() override { return StackViewController::depth() == 2; } //TODO LEA factorize with math toolbox /* VariableBoxController */ void loadFunctionsAndVariables(int scriptIndex, const char * textToAutocomplete, int textToAutocompleteLength); diff --git a/apps/math_variable_box_controller.h b/apps/math_variable_box_controller.h index 25bb29703..8e6052a11 100644 --- a/apps/math_variable_box_controller.h +++ b/apps/math_variable_box_controller.h @@ -47,7 +47,6 @@ private: const char * extension() const; Ion::Storage::Record recordAtIndex(int rowIndex); ViewController * emptyViewController() override; - bool isDisplayingEmptyController() override { return StackViewController::depth() == 2; } void resetMemoization(); void destroyRecordAtRowIndex(int rowIndex); Page m_currentPage;