From 5395f21ae5a3d8fde961b6d72792d2f8472ad7cd Mon Sep 17 00:00:00 2001 From: TryTwo Date: Thu, 2 Jan 2025 03:04:13 -0700 Subject: 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. --- Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp') diff --git a/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp index bd94cde5b8..f87190fa9a 100644 --- a/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp +++ b/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp @@ -232,7 +232,10 @@ void GeneralWidget::OnEmulationStateChanged(bool running) std::string current_backend = m_backend_combo->currentData().toString().toStdString(); if (Config::Get(Config::MAIN_GFX_BACKEND) != current_backend) { - m_backend_combo->Load(); + { + const QSignalBlocker blocker(m_backend_combo); + m_backend_combo->Load(); + } emit BackendChanged(QString::fromStdString(Config::Get(Config::MAIN_GFX_BACKEND))); } } -- cgit v1.2.3