[apps] Put the method preference in container instead of in every app

Change-Id: Ib390952a6559aa847c99e3ca74c4f6995a07e909
This commit is contained in:
Émilie Feral
2017-01-31 16:15:04 +01:00
parent ab65e832ea
commit 47cec5e72b
10 changed files with 27 additions and 31 deletions

View File

@@ -1,5 +1,6 @@
#include "edit_expression_controller.h"
#include "app.h"
#include "../apps_container.h"
#include <assert.h>
namespace Calculation {
@@ -81,7 +82,8 @@ bool EditExpressionController::textFieldDidReceiveEvent(::TextField * textField,
bool EditExpressionController::textFieldDidFinishEditing(::TextField * textField, const char * text) {
App * calculationApp = (App *)app();
m_calculationStore->push(textBody(), calculationApp->localContext(), calculationApp->preferences());
AppsContainer * appsContainer = (AppsContainer *)calculationApp->container();
m_calculationStore->push(textBody(), calculationApp->localContext(), appsContainer->preferences());
m_historyController->reload();
m_contentView.mainView()->scrollToCell(0, m_historyController->numberOfRows()-1);
m_contentView.textField()->setText("");