all repos — mgba @ 6066c6e3739ff46ace5f49eddcf2024180c9f74c

mGBA Game Boy Advance Emulator

Qt: Fix boolean setting loading
Jeffrey Pfau jeffrey@endrift.com
Sun, 09 Nov 2014 23:44:06 -0800
commit

6066c6e3739ff46ace5f49eddcf2024180c9f74c

parent

ea66055c63fe0ffaeee010efaf82cd33964e24b1

1 files changed, 6 insertions(+), 2 deletions(-)

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

@@ -42,7 +42,7 @@ QObject::connect(action, &QAction::triggered, [this, action]() {

emit valueChanged(action->isChecked()); }); parent->addAction(action); - m_actions.append(qMakePair(action, true)); + m_actions.append(qMakePair(action, 1)); return action; }

@@ -126,7 +126,7 @@ m_optionSet[optionName]->setValue(GBAConfigGetValue(&m_config, key));

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

@@ -158,6 +158,10 @@ }

} void ConfigController::setOption(const char* key, const QVariant& value) { + if (value.type() == QVariant::Bool) { + setOption(key, value.toBool()); + return; + } QString stringValue(value.toString()); setOption(key, stringValue.toLocal8Bit().constData()); }