From fdaec27ad9f458e7a2554a293635e401b9619779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Fri, 6 Sep 2019 17:31:38 +0200 Subject: [PATCH] [apps/graph] CurveParameterController: reload data when view appears rather than set null frame when disappearing in order to reload model --- apps/graph/graph/curve_parameter_controller.cpp | 7 ++----- apps/graph/graph/curve_parameter_controller.h | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/apps/graph/graph/curve_parameter_controller.cpp b/apps/graph/graph/curve_parameter_controller.cpp index 87e6b2bf0..99f644119 100644 --- a/apps/graph/graph/curve_parameter_controller.cpp +++ b/apps/graph/graph/curve_parameter_controller.cpp @@ -76,11 +76,8 @@ int CurveParameterController::reusableCellCount() { return 1 + (shouldDisplayCalculationAndDerivative() ? 2 : 0); } -void CurveParameterController::viewDidDisappear() { - /* Deselect the table properly because it needs to be relayouted the next time - * it appears: the number of rows might change according to the plot type. */ - m_selectableTableView.deselectTable(false); - m_selectableTableView.setFrame(KDRectZero); +void CurveParameterController::viewWillAppear() { + m_selectableTableView.reloadData(); } bool CurveParameterController::shouldDisplayCalculationAndDerivative() const { diff --git a/apps/graph/graph/curve_parameter_controller.h b/apps/graph/graph/curve_parameter_controller.h index fd7086dfe..f3bd82980 100644 --- a/apps/graph/graph/curve_parameter_controller.h +++ b/apps/graph/graph/curve_parameter_controller.h @@ -18,7 +18,7 @@ public: HighlightCell * reusableCell(int index) override; int reusableCellCount() override; void willDisplayCellForIndex(HighlightCell * cell, int index) override; - void viewDidDisappear() override; + void viewWillAppear() override; private: bool shouldDisplayCalculationAndDerivative() const; int cellIndex(int visibleCellIndex) const;