Qt: Fix boolean setting loading
Jeffrey Pfau jeffrey@endrift.com
Sun, 09 Nov 2014 23:44:06 -0800
1 files changed,
6 insertions(+),
2 deletions(-)
M
src/platform/qt/ConfigController.cpp
→
src/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()); }