Qt: Fix config options being erroneously added as null
Jeffrey Pfau jeffrey@endrift.com
Sun, 21 Dec 2014 16:01:55 -0800
1 files changed,
12 insertions(+),
12 deletions(-)
M
src/platform/qt/ConfigController.cpp
→
src/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); } }