rbutil: more path suffix support

This commit adds suffix support for some missing components:
- Info widget
- Voice/talk files generation
- Backup
- Uninstall

Also fixes a crash in the uninstall window when there's no bootloader to select.

Change-Id: Ie97505a8cbd12dddf160bdebae2c04e738c373e5
This commit is contained in:
Hairo R. Carela 2026-01-02 00:15:40 -04:00 committed by Solomon Peachy
parent 8aec8ee686
commit f13f80c506
7 changed files with 55 additions and 7 deletions

View file

@ -238,7 +238,16 @@ bool TalkFileCreator::copyTalkFiles(QString* errString)
int m_progress = 0;
emit logProgress(m_progress,progressMax);
QSettings installlog(m_mountpoint + "/.rockbox/rbutil.log", QSettings::IniFormat, nullptr);
QString suffix = RbSettings::value(RbSettings::Suffix).toString();
QString logpath;
if (!suffix.isEmpty()) {
logpath = m_mountpoint + suffix + "/.rockbox/rbutil.log";
} else {
logpath = m_mountpoint + "/.rockbox/rbutil.log";
}
QSettings installlog(logpath, QSettings::IniFormat, nullptr);
installlog.beginGroup("talkfiles");
for(int i=0; i < m_talkList.size(); i++)

View file

@ -120,7 +120,10 @@ QStringList Uninstaller::getAllSections()
{
QSettings installlog(m_mountpoint + "/.rockbox/rbutil.log", QSettings::IniFormat, nullptr);
QStringList allSections = installlog.childGroups();
allSections.removeAt(allSections.lastIndexOf("Bootloader"));
int bl_index = allSections.lastIndexOf("Bootloader");
if (bl_index > -1) allSections.removeAt(bl_index);
return allSections;
}

View file

@ -53,7 +53,16 @@ void CreateVoiceWindow::accept()
saveSettings();
//configure voicecreator
voicecreator->setMountPoint(RbSettings::value(RbSettings::Mountpoint).toString());
QString suffix = RbSettings::value(RbSettings::Suffix).toString();
QString mountpoint = RbSettings::value(RbSettings::Mountpoint).toString();
if (!suffix.isEmpty()) {
QString fullpath = mountpoint + suffix;
voicecreator->setMountPoint(fullpath);
} else {
voicecreator->setMountPoint(mountpoint);
}
voicecreator->setLang(ui.comboLanguage->itemData(ui.comboLanguage->currentIndex()).toString());
voicecreator->setWavtrimThreshold(ui.wavtrimthreshold->value());

View file

@ -67,7 +67,15 @@ BackupDialog::BackupDialog(QWidget* parent) : QDialog(parent)
connect(ui.buttonBackup, &QAbstractButton::clicked, this, &BackupDialog::backup);
ui.backupSize->setText(tr("Installation size: calculating ..."));
m_mountpoint = RbSettings::value(RbSettings::Mountpoint).toString();
QString mp = RbSettings::value(RbSettings::Mountpoint).toString();
QString suffix = RbSettings::value(RbSettings::Suffix).toString();
if (!suffix.isEmpty()) {
m_mountpoint = mp + suffix;
} else {
m_mountpoint = mp;
}
m_backupName = RbSettings::value(RbSettings::BackupPath).toString();
if(m_backupName.isEmpty()) {

View file

@ -39,7 +39,16 @@ void InfoWidget::updateInfo(void)
LOG_INFO() << "updating install info";
QString mp = RbSettings::value(RbSettings::Mountpoint).toString();
QSettings log(mp + "/.rockbox/rbutil.log", QSettings::IniFormat, this);
QString suff = RbSettings::value(RbSettings::Suffix).toString();
QString logpath;
if (!suff.isEmpty()) {
logpath = mp + suff + "/.rockbox/rbutil.log";
} else {
logpath = mp + "/.rockbox/rbutil.log";
}
QSettings log(logpath, QSettings::IniFormat, this);
QStringList groups = log.childGroups();
QTreeWidgetItem *w, *w2;
QString min, max;

View file

@ -51,7 +51,6 @@ SelectiveInstallWidget::SelectiveInstallWidget(QWidget* parent) : QWidget(parent
m_logger = nullptr;
m_zipinstaller = nullptr;
m_suffix = RbSettings::value(RbSettings::Suffix).toString();
m_themesinstaller = new ThemesInstallWindow(this);
connect(m_themesinstaller, &ThemesInstallWindow::selected,
[this](int count) {ui.themesCheckbox->setChecked(count > 0);});
@ -114,6 +113,7 @@ void SelectiveInstallWidget::updateVersion(void)
{
// get some configuration values globally
m_mountpoint = RbSettings::value(RbSettings::Mountpoint).toString();
m_suffix = RbSettings::value(RbSettings::Suffix).toString();
m_target = RbSettings::value(RbSettings::CurrentPlatform).toString();
m_blmethod = PlayerBuildInfo::instance()->value(
PlayerBuildInfo::BootloaderMethod, m_target).toString();

View file

@ -16,6 +16,8 @@
*
****************************************************************************/
#include <QtCore>
#include "Logger.h"
#include "uninstallwindow.h"
#include "ui_uninstallfrm.h"
#include "rbsettings.h"
@ -28,8 +30,16 @@ UninstallWindow::UninstallWindow(QWidget *parent) : QDialog(parent)
connect(ui.CompleteRadioBtn,&QAbstractButton::toggled,this,&UninstallWindow::UninstallMethodChanged);
QString mountpoint = RbSettings::value(RbSettings::Mountpoint).toString();
QString suffix = RbSettings::value(RbSettings::Suffix).toString();
uninstaller = new Uninstaller(this,mountpoint);
QString path;
if (!suffix.isEmpty()) {
path = mountpoint + suffix;
} else {
path = mountpoint;
}
uninstaller = new Uninstaller(this, path);
logger = new ProgressLoggerGui(this);
connect(uninstaller, &Uninstaller::logItem, logger, &ProgressLoggerGui::addItem);
connect(uninstaller, &Uninstaller::logProgress, logger, &ProgressLoggerGui::setProgress);