diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2020-11-22 19:37:19 +0100 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2020-11-23 20:44:46 +0100 |
commit | ec730f1609181a7fbf907f9e57380b2695ed6cbb (patch) | |
tree | 30a3f4f07c1265202b517fe61341f3194dd6417c /rbutil | |
parent | 64fe7e03a821138648edd8fdf19efc1ce019ff5e (diff) |
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
Diffstat (limited to 'rbutil')
-rw-r--r-- | rbutil/rbutilqt/gui/selectiveinstallwidget.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/rbutil/rbutilqt/gui/selectiveinstallwidget.cpp b/rbutil/rbutilqt/gui/selectiveinstallwidget.cpp index cc5abb40ad..902f9861ed 100644 --- a/rbutil/rbutilqt/gui/selectiveinstallwidget.cpp +++ b/rbutil/rbutilqt/gui/selectiveinstallwidget.cpp @@ -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") { |