DEV9: Use a signal blocker instead of disconnecting signal

This commit is contained in:
TheLastRar authored and Connor McLaughlin committed 2024-04-23 13:19:59 +10:00
1 parent 5af5fe8387
commit cd907584ee
1 file changed
+2 -3
+2 -3
View File
@@ -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<int>(Pcsx2Config::DEV9Options::NetApi::Unset)]).value();
//disconnect temporally to prevent saving a vaule already in the config file
disconnect(m_ui.ethDev, QOverload<int>::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<int>::of(&QComboBox::currentIndexChanged), this, &DEV9SettingsWidget::onEthDeviceChanged);
}
/*