From 40aa86ccb7436d4894756da3a9084e9eef57469e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Tue, 2 May 2017 11:42:01 +0200 Subject: [PATCH] [apps/calculation] EXE and OK have same behaviour on history controller Change-Id: I4fed572db45e4604a1b44e5343f14b50db8cfcc6 --- apps/calculation/history_controller.cpp | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/apps/calculation/history_controller.cpp b/apps/calculation/history_controller.cpp index 6f20851dd..b3825f14c 100644 --- a/apps/calculation/history_controller.cpp +++ b/apps/calculation/history_controller.cpp @@ -35,7 +35,7 @@ bool HistoryController::handleEvent(Ion::Events::Event event) { if (event == Ion::Events::Up) { return true; } - if (event == Ion::Events::OK) { + if (event == Ion::Events::OK || event == Ion::Events::EXE) { int focusRow = selectedRow(); HistoryViewCell * selectedCell = (HistoryViewCell *)selectableTableView()->selectedCell(); HistoryViewCell::SubviewType subviewType = selectedCell->selectedSubviewType(); @@ -50,26 +50,6 @@ bool HistoryController::handleEvent(Ion::Events::Event event) { } return true; } - if (event == Ion::Events::EXE) { - int focusRow = selectedRow(); - HistoryViewCell * selectedCell = (HistoryViewCell *)selectableTableView()->selectedCell(); - HistoryViewCell::SubviewType subviewType = selectedCell->selectedSubviewType(); - EditExpressionController * editController = (EditExpressionController *)parentResponder(); - Calculation * calculation = m_calculationStore->calculationAtIndex(focusRow); - const char * text; - if (subviewType == HistoryViewCell::SubviewType::Input) { - text = calculation->inputText(); - } else { - text = calculation->outputText(); - } - selectableTableView()->deselectTable(); - App * calculationApp = (App *)app(); - m_calculationStore->push(text, calculationApp->localContext()); - reload(); - selectableTableView()->scrollToCell(0, numberOfRows()-1); - app()->setFirstResponder(editController); - return true; - } if (event == Ion::Events::Backspace) { int focusRow = selectedRow(); HistoryViewCell * selectedCell = (HistoryViewCell *)selectableTableView()->selectedCell();