Merge pull request #13411 from jordan-woyak/gui-vconfig

DolphinQt/GeneralWidget: Eliminate unnecessary g_Config usage.
This commit is contained in:
OatmealDome 2025-03-16 14:54:24 -04:00 committed by GitHub
commit 9720b1f5f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -165,7 +165,6 @@ void GeneralWidget::ConnectWidgets()
// Video Backend
connect(m_backend_combo, &QComboBox::currentIndexChanged, this, &GeneralWidget::BackendWarning);
connect(m_adapter_combo, &QComboBox::currentIndexChanged, this, [&](int index) {
g_Config.iAdapter = index;
Config::SetBaseOrCurrent(Config::GFX_ADAPTER, index);
emit BackendChanged(QString::fromStdString(Config::Get(Config::MAIN_GFX_BACKEND)));
});
@ -369,7 +368,10 @@ void GeneralWidget::OnBackendChanged(const QString& backend_name)
const bool supports_adapters = !adapters.empty();
m_adapter_combo->setCurrentIndex(g_Config.iAdapter);
const int adapter_index = Config::Get(Config::GFX_ADAPTER);
if (adapter_index < m_adapter_combo->count())
m_adapter_combo->setCurrentIndex(adapter_index);
m_adapter_combo->setEnabled(supports_adapters &&
Core::IsUninitialized(Core::System::GetInstance()));