From 02ba89380324183c66d4874280e2c2dccf529132 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 6 Oct 2019 20:40:31 +0200 Subject: [PATCH] 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.) --- Source/Core/DolphinQt/Settings/AudioPane.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/Core/DolphinQt/Settings/AudioPane.cpp b/Source/Core/DolphinQt/Settings/AudioPane.cpp index 856a97dc6b..4d780a3e1b 100644 --- a/Source/Core/DolphinQt/Settings/AudioPane.cpp +++ b/Source/Core/DolphinQt/Settings/AudioPane.cpp @@ -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();