Fixed #246: Dropdown controls regarding Floppy and CD drive were changed always to the last value entered on an update

This commit is contained in:
Dimitris Panokostas 2018-02-12 14:38:14 +01:00
parent 673a0dc5f3
commit 667cd86543
3 changed files with 4 additions and 4 deletions

View file

@ -51,7 +51,7 @@ static bool bIgnoreListChange = false;
class DriveTypeListModel : public gcn::ListModel
{
private:
std::vector<std::string> types;
std::vector<std::string> types{};
public:
DriveTypeListModel()
@ -555,7 +555,7 @@ static void AdjustDropDownControls()
{
for (unsigned int j = 0; j < lstMRUDiskList.size(); ++j)
{
if (lstMRUDiskList[j].c_str() != changed_prefs.floppyslots[i].df)
if (strcmp(lstMRUDiskList[j].c_str(), changed_prefs.floppyslots[i].df) == 0)
{
cboDFxFile[i]->setSelected(j);
break;

View file

@ -553,7 +553,7 @@ static void AdjustDropDownControls()
{
for (unsigned int i = 0; i < lstMRUCDList.size(); ++i)
{
if (lstMRUCDList[i].c_str() != changed_prefs.cdslots[0].name)
if (strcmp(lstMRUCDList[i].c_str(), changed_prefs.cdslots[0].name) == 0)
{
cboCDFile->setSelected(i);
break;

View file

@ -838,7 +838,7 @@ static void AdjustDropDownControls(void)
{
for (unsigned int j = 0; j < lstMRUDiskList.size(); ++j)
{
if (lstMRUDiskList[j].c_str() != changed_prefs.floppyslots[i].df)
if (strcmp(lstMRUDiskList[j].c_str(), changed_prefs.floppyslots[i].df) == 0)
{
cboDFxFile[i]->setSelected(j);
break;