mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Qt, Config controls system: Remove signal block so signals can refresh the enabled status of certain options when a new config is loaded (such as on starting a game). Blocks previously unwanted behavior with a new safety check.
QCheckBox::toggled and other similar signals are used to save changes and to update widget status (such as enabled).. OnConfigChanged needs to load new values and trigger widget updates, but the new value shouldn't trigger a save. A save is unnecessary (the config has the correct values and the UI is being updated to those values) and it'd trigger another ConfigChanged signal. This commit blocks the save without blocking the signal entirely.
This commit is contained in:
@ -63,7 +63,6 @@ void ConfigStringChoice::Load()
|
||||
const int index = m_text_is_data ? findText(setting_value) : findData(setting_value);
|
||||
|
||||
// This can be called publicly.
|
||||
const QSignalBlocker block(this);
|
||||
setCurrentIndex(index);
|
||||
}
|
||||
|
||||
@ -145,6 +144,7 @@ void ConfigComplexChoice::UpdateComboIndex()
|
||||
auto it = std::find(m_options.begin(), m_options.end(), values);
|
||||
int index = static_cast<int>(std::distance(m_options.begin(), it));
|
||||
|
||||
// Will crash if not blocked
|
||||
const QSignalBlocker blocker(this);
|
||||
setCurrentIndex(index);
|
||||
}
|
||||
|
Reference in New Issue
Block a user