all repos — mgba @ 22826f2e7ac1350fc43b60694bad8631054f5597

mGBA Game Boy Advance Emulator

Qt: Fix config options being erroneously added as null
Jeffrey Pfau jeffrey@endrift.com
Sun, 21 Dec 2014 16:01:55 -0800
commit

22826f2e7ac1350fc43b60694bad8631054f5597

parent

4420309dc58237a044879278750bafd54dc18462

1 files changed, 12 insertions(+), 12 deletions(-)

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

@@ -132,33 +132,33 @@ }

void ConfigController::setOption(const char* key, bool value) { GBAConfigSetIntValue(&m_config, key, value); - ConfigOption* option = m_optionSet[QString(key)]; - if (option) { - option->setValue(value); + QString optionName(key); + if (m_optionSet.contains(optionName)) { + m_optionSet[optionName]->setValue(value); } } void ConfigController::setOption(const char* key, int value) { GBAConfigSetIntValue(&m_config, key, value); - ConfigOption* option = m_optionSet[QString(key)]; - if (option) { - option->setValue(value); + QString optionName(key); + if (m_optionSet.contains(optionName)) { + m_optionSet[optionName]->setValue(value); } } void ConfigController::setOption(const char* key, unsigned value) { GBAConfigSetUIntValue(&m_config, key, value); - ConfigOption* option = m_optionSet[QString(key)]; - if (option) { - option->setValue(value); + QString optionName(key); + if (m_optionSet.contains(optionName)) { + m_optionSet[optionName]->setValue(value); } } void ConfigController::setOption(const char* key, const char* value) { GBAConfigSetValue(&m_config, key, value); - ConfigOption* option = m_optionSet[QString(key)]; - if (option) { - option->setValue(value); + QString optionName(key); + if (m_optionSet.contains(optionName)) { + m_optionSet[optionName]->setValue(value); } }