[settings] Fix MainController with new Poincare API

This commit is contained in:
Émilie Feral
2018-09-06 15:00:08 +02:00
parent 174c581474
commit dde781b06a
2 changed files with 3 additions and 19 deletions

View File

@@ -44,7 +44,7 @@ MainController::MainController(Responder * parentResponder) :
#endif
m_complexFormatCell(I18n::Message::Default, KDText::FontSize::Large),
m_brightnessCell(I18n::Message::Default, KDText::FontSize::Large),
m_complexFormatLayout(nullptr),
m_complexFormatLayout(),
m_selectableTableView(this),
m_messageTreeModel((MessageTree *)&model),
m_subController(this),
@@ -55,13 +55,6 @@ MainController::MainController(Responder * parentResponder) :
}
}
MainController::~MainController() {
if (m_complexFormatLayout) {
delete m_complexFormatLayout;
m_complexFormatLayout = nullptr;
}
}
View * MainController::view() {
return &m_selectableTableView;
}
@@ -173,17 +166,13 @@ void MainController::willDisplayCellForIndex(HighlightCell * cell, int index) {
myCell->setMessage(m_messageTreeModel->children(index)->label());
if (index == 3) {
if (m_complexFormatLayout) {
delete m_complexFormatLayout;
m_complexFormatLayout = nullptr;
}
if (Preferences::sharedPreferences()->complexFormat() == Preferences::ComplexFormat::Cartesian) {
m_complexFormatLayout = Helpers::CartesianComplexFormat(KDText::FontSize::Small);
} else {
m_complexFormatLayout = Helpers::PolarComplexFormat(KDText::FontSize::Small);
}
MessageTableCellWithChevronAndExpression * myExpCell = (MessageTableCellWithChevronAndExpression *)cell;
myExpCell->setExpressionLayout(m_complexFormatLayout);
myExpCell->setLayoutRef(m_complexFormatLayout);
return;
}
if (index == 4) {