rbutil: Fix selecting the previously selected build type.

When starting Rockbox Utility select the same build type that was used
during the previous run. This broke during refactoring, fix it.

Change-Id: Ibbca3431cbfe65daedd3e5783e0940d83d1594a6
This commit is contained in:
Dominik Riebeling 2020-11-22 19:37:19 +01:00
parent 64fe7e03a8
commit ec730f1609

View file

@ -147,18 +147,17 @@ void SelectiveInstallWidget::updateVersion(void)
}
// select previously selected version
int index = ui.selectedVersion->findData(RbSettings::value(RbSettings::Build).toString());
if(index != -1) {
ui.selectedVersion->setCurrentIndex(index);
}
else if(!m_versions[SystemInfo::BuildRelease].isEmpty()) {
index = ui.selectedVersion->findData("release");
ui.selectedVersion->setCurrentIndex(index);
}
else {
index = ui.selectedVersion->findData("development");
ui.selectedVersion->setCurrentIndex(index);
int index = ui.selectedVersion->findData(
static_cast<SystemInfo::BuildType>(RbSettings::value(RbSettings::Build).toInt()));
if(index < 0) {
if(!m_versions[SystemInfo::BuildRelease].isEmpty()) {
index = ui.selectedVersion->findData(SystemInfo::BuildRelease);
}
else {
index = ui.selectedVersion->findData(SystemInfo::BuildCurrent);
}
}
ui.selectedVersion->setCurrentIndex(index);
// check if Rockbox is installed. If it is untick the bootloader option, as
// well as if the selected player doesn't need a bootloader.
if(m_blmethod == "none") {