From 2fa1ce51dd3cb00eef289094fe9f660c237254bc Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 20 May 2015 00:21:45 +0200 Subject: [PATCH] GUI: Simplify OPL option code a bit. --- gui/options.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gui/options.cpp b/gui/options.cpp index 726b89d4378..ba247e5f15c 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -445,11 +445,9 @@ void OptionsDialog::close() { if (_oplPopUp) { if (_enableAudioSettings) { - const OPL::Config::EmulatorDescription *ed = OPL::Config::getAvailable(); - while (ed->name && ed->id != (int)_oplPopUp->getSelectedTag()) - ++ed; + const OPL::Config::EmulatorDescription *ed = OPL::Config::findDriver(_oplPopUp->getSelectedTag()); - if (ed->name) + if (ed) ConfMan.set("opl_driver", ed->name, _domain); else ConfMan.removeKey("opl_driver", _domain);