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:
parent
b6545ea285
commit
02ba893803
|
@ -181,12 +181,18 @@ void AudioPane::LoadSettings()
|
||||||
|
|
||||||
// Backend
|
// Backend
|
||||||
const auto current = SConfig::GetInstance().sBackend;
|
const auto current = SConfig::GetInstance().sBackend;
|
||||||
|
bool selection_set = false;
|
||||||
for (const auto& backend : AudioCommon::GetSoundBackends())
|
for (const auto& backend : AudioCommon::GetSoundBackends())
|
||||||
{
|
{
|
||||||
m_backend_combo->addItem(tr(backend.c_str()), QVariant(QString::fromStdString(backend)));
|
m_backend_combo->addItem(tr(backend.c_str()), QVariant(QString::fromStdString(backend)));
|
||||||
if (backend == current)
|
if (backend == current)
|
||||||
|
{
|
||||||
m_backend_combo->setCurrentIndex(m_backend_combo->count() - 1);
|
m_backend_combo->setCurrentIndex(m_backend_combo->count() - 1);
|
||||||
|
selection_set = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (!selection_set)
|
||||||
|
m_backend_combo->setCurrentIndex(-1);
|
||||||
|
|
||||||
OnBackendChanged();
|
OnBackendChanged();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue