[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
This commit is contained in:
Léa Saviot
2020-04-30 16:26:36 +02:00
committed by Émilie Feral
parent c5f2f7cf83
commit 68867e45e7
3 changed files with 1 additions and 3 deletions

View File

@@ -12,7 +12,7 @@ public:
void viewDidDisappear() override; void viewDidDisappear() override;
protected: protected:
virtual ViewController * emptyViewController() = 0; virtual ViewController * emptyViewController() = 0;
virtual bool isDisplayingEmptyController() = 0; bool isDisplayingEmptyController() { return StackViewController::depth() == 2; }
bool displayEmptyControllerIfNeeded(); bool displayEmptyControllerIfNeeded();
}; };

View File

@@ -32,7 +32,6 @@ public:
//AlternateEmptyNestedMenuController //AlternateEmptyNestedMenuController
ViewController * emptyViewController() override { return &m_variableBoxEmptyController; } ViewController * emptyViewController() override { return &m_variableBoxEmptyController; }
bool isDisplayingEmptyController() override { return StackViewController::depth() == 2; } //TODO LEA factorize with math toolbox
/* VariableBoxController */ /* VariableBoxController */
void loadFunctionsAndVariables(int scriptIndex, const char * textToAutocomplete, int textToAutocompleteLength); void loadFunctionsAndVariables(int scriptIndex, const char * textToAutocomplete, int textToAutocompleteLength);

View File

@@ -47,7 +47,6 @@ private:
const char * extension() const; const char * extension() const;
Ion::Storage::Record recordAtIndex(int rowIndex); Ion::Storage::Record recordAtIndex(int rowIndex);
ViewController * emptyViewController() override; ViewController * emptyViewController() override;
bool isDisplayingEmptyController() override { return StackViewController::depth() == 2; }
void resetMemoization(); void resetMemoization();
void destroyRecordAtRowIndex(int rowIndex); void destroyRecordAtRowIndex(int rowIndex);
Page m_currentPage; Page m_currentPage;