From cd907584eefc99e271f4e021093a4a3cb74a23d2 Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Tue, 16 Apr 2024 20:39:01 +0100 Subject: [PATCH] DEV9: Use a signal blocker instead of disconnecting signal --- pcsx2-qt/Settings/DEV9SettingsWidget.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pcsx2-qt/Settings/DEV9SettingsWidget.cpp b/pcsx2-qt/Settings/DEV9SettingsWidget.cpp index 6e49ea5a17..af84b967e9 100644 --- a/pcsx2-qt/Settings/DEV9SettingsWidget.cpp +++ b/pcsx2-qt/Settings/DEV9SettingsWidget.cpp @@ -836,8 +836,8 @@ void DEV9SettingsWidget::showEvent(QShowEvent* event) //This means that this setting can get out of sync with true value, so revert to that if the ui is closed and opened const std::string value = m_dialog->getStringValue("DEV9/Eth", "EthApi", Pcsx2Config::DEV9Options::NetApiNames[static_cast(Pcsx2Config::DEV9Options::NetApi::Unset)]).value(); - //disconnect temporally to prevent saving a vaule already in the config file - disconnect(m_ui.ethDev, QOverload::of(&QComboBox::currentIndexChanged), this, &DEV9SettingsWidget::onEthDeviceChanged); + //SignalBlocker to prevent saving a value already in the config file + QSignalBlocker sb(m_ui.ethDev); for (int i = 0; m_api_namelist[i] != nullptr; i++) { if (value == m_api_valuelist[i]) @@ -846,7 +846,6 @@ void DEV9SettingsWidget::showEvent(QShowEvent* event) break; } } - connect(m_ui.ethDev, QOverload::of(&QComboBox::currentIndexChanged), this, &DEV9SettingsWidget::onEthDeviceChanged); } /*