Merge pull request #8392 from JosJuice/audio-backend-dropdown-default

DolphinQt: When audio backend is invalid, show nothing in dropdown
This commit is contained in:
Connor McLaughlin 2019-10-07 10:45:07 +10:00 committed by GitHub
commit 12b47c9487
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -181,12 +181,18 @@ void AudioPane::LoadSettings()
// Backend
const auto current = SConfig::GetInstance().sBackend;
bool selection_set = false;
for (const auto& backend : AudioCommon::GetSoundBackends())
{
m_backend_combo->addItem(tr(backend.c_str()), QVariant(QString::fromStdString(backend)));
if (backend == current)
{
m_backend_combo->setCurrentIndex(m_backend_combo->count() - 1);
selection_set = true;
}
}
if (!selection_set)
m_backend_combo->setCurrentIndex(-1);
OnBackendChanged();