all repos — mgba @ 38c8e4c4e1d04ef3a6d3439a9c0c55499dd9e701

mGBA Game Boy Advance Emulator

Qt: Fix battlechip crashes
Vicki Pfau vi@endrift.com
Tue, 26 Feb 2019 18:23:07 -0800
commit

38c8e4c4e1d04ef3a6d3439a9c0c55499dd9e701

parent

8b88e7ae6a4434b37a4812accea648cdbb62331d

1 files changed, 4 insertions(+), 0 deletions(-)

jump to
M src/platform/qt/BattleChipView.cppsrc/platform/qt/BattleChipView.cpp

@@ -46,6 +46,9 @@ connect(m_ui.chipId, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), m_ui.inserted, [this]() {

m_ui.inserted->setChecked(Qt::Unchecked); }); connect(m_ui.chipName, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), m_ui.chipId, [this](int id) { + if (id < 0) { + return; + } m_ui.chipId->setValue(m_model.chipNames().keys()[id]); });

@@ -107,6 +110,7 @@

void BattleChipView::setFlavor(int flavor) { m_controller->setBattleChipFlavor(flavor); m_model.setFlavor(flavor); + m_ui.chipName->clear(); m_ui.chipName->addItems(m_model.chipNames().values()); }