[apps/settings] Fix broken assert

Pressing OK or EXE with the brightness setting selected would cause a
crash because of a mishandling of the events for this cell.

Change-Id: I4978b4f749b5f19bc1e49ec05b60a32044d86638
This commit is contained in:
Gabriel Ozouf
2020-08-27 11:20:14 +02:00
committed by Émilie Feral
parent d6c7b2b1ac
commit 9be5e7671c

View File

@@ -65,7 +65,11 @@ bool MainController::handleEvent(Ion::Events::Event event) {
}
if (event == Ion::Events::OK || event == Ion::Events::EXE || event == Ion::Events::Right) {
assert(rowIndex != k_indexOfBrightnessCell);
if (rowIndex == k_indexOfBrightnessCell) {
/* Nothing is supposed to happen when OK or EXE are pressed on the
* brightness cell. The case of pressing Right has been handled above. */
return true;
}
if (rowIndex == k_indexOfLanguageCell) {
m_localizationController.setMode(LocalizationController::Mode::Language);