DolphinQt: When audio backend is invalid, show nothing in dropdown

It used to show the first option, No Audio Output (but audio output
would work correctly anyway since AudioCommon didn't use this logic.)
This commit is contained in:
JosJuice 2019-10-06 20:40:31 +02:00
parent b6545ea285
commit 02ba893803
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();