From 22826f2e7ac1350fc43b60694bad8631054f5597 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Sun, 21 Dec 2014 16:01:55 -0800 Subject: [PATCH] Qt: Fix config options being erroneously added as null --- src/platform/qt/ConfigController.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/platform/qt/ConfigController.cpp b/src/platform/qt/ConfigController.cpp index f576e5a08..7e9f901b1 100644 --- a/src/platform/qt/ConfigController.cpp +++ b/src/platform/qt/ConfigController.cpp @@ -132,33 +132,33 @@ void ConfigController::updateOption(const char* key) { 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); } }