Extend bootloader installation to accept alternatives for the destination filename.

Remove the hardcoded special case for the H10 bootloader installation and uninstallation. Allow multiple bootloader filenames to be present and pick the existing one on (un)installation. This is also needed for easily adding support for the Samsung YH players (to make FS#10373 actually work).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22220 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dominik Riebeling 2009-08-09 10:57:39 +00:00
parent 63ba647ee0
commit 0b7bfb6270
4 changed files with 32 additions and 27 deletions

View file

@ -187,3 +187,19 @@ QString BootloaderInstallBase::postinstallHints(QString model)
return QString("");
}
//! @brief set list of possible bootloader files and pick the existing one.
//! @param sl list of possible bootloader files.
void BootloaderInstallBase::setBlFile(QStringList sl)
{
// figue which of the possible bootloader filenames is correct.
for(int a = 0; a < sl.size(); a++) {
if(!resolvePathCase(sl.at(a)).isEmpty()) {
m_blfile = sl.at(a);
}
}
if(m_blfile.isEmpty()) {
m_blfile = sl.at(0);
}
}

View file

@ -56,9 +56,8 @@ class BootloaderInstallBase : public QObject
//! backup a already installed bootloader
bool backup(QString to);
//! set the differen filenames and paths
void setBlFile(QString f)
{ m_blfile = f; }
//! set the different filenames and paths
void setBlFile(QStringList f);
void setBlUrl(QUrl u)
{ m_blurl = u; }
void setLogfile(QString f)

View file

@ -192,7 +192,7 @@ name="H10 (5 / 6GB) UMS"
buildserver_modelname=h10_5gb
bootloadermethod=mi4
bootloadername=/iriver/H10.mi4
bootloaderfile=/System/H10.mi4
bootloaderfile=/System/H10.mi4, /System/H10EMP.mi4
resolution=128x128x16
manualname=
brand=Iriver
@ -206,7 +206,7 @@ name="H10 (5 / 6GB) MTP"
buildserver_modelname=h10_5gb
bootloadermethod=mi4
bootloadername=/iriver/H10_5GB-MTP/H10.mi4
bootloaderfile=/System/H10.mi4
bootloaderfile=/System/H10.mi4, /System/H10EMP.mi4
resolution=128x128x16
manualname=
brand=Iriver

View file

@ -657,20 +657,13 @@ void RbUtilQt::installBootloader()
}
// set bootloader filename. Do this now as installed() needs it.
QString blfile;
blfile = RbSettings::value(RbSettings::Mountpoint).toString()
+ RbSettings::value(RbSettings::CurBootloaderFile).toString();
// special case for H10 pure: this player can have a different
// bootloader file filename. This is handled here to keep the install
// class clean, though having it here is also not the nicest solution.
if(RbSettings::value(RbSettings::Platform).toString() == "h10_ums"
|| RbSettings::value(RbSettings::Platform) == "h10_mtp") {
if(resolvePathCase(blfile).isEmpty())
blfile = RbSettings::value(RbSettings::Mountpoint).toString()
+ RbSettings::value(RbSettings::CurBootloaderName).toString()
.replace("H10", "H10EMP", Qt::CaseInsensitive);
QStringList blfile = RbSettings::value(RbSettings::CurBootloaderFile).toStringList();
QStringList blfilepath;
for(int a = 0; a < blfile.size(); a++) {
blfilepath.append(RbSettings::value(RbSettings::Mountpoint).toString()
+ blfile.at(a));
}
bl->setBlFile(blfile);
bl->setBlFile(blfilepath);
QUrl url(RbSettings::value(RbSettings::BootloaderUrl).toString()
+ RbSettings::value(RbSettings::CurBootloaderName).toString());
bl->setBlUrl(url);
@ -998,16 +991,13 @@ void RbUtilQt::uninstallBootloader(void)
return;
}
QString blfile = RbSettings::value(RbSettings::Mountpoint).toString()
+ RbSettings::value(RbSettings::CurBootloaderFile).toString();
if(RbSettings::value(RbSettings::Platform).toString() == "h10_ums"
|| RbSettings::value(RbSettings::Platform).toString() == "h10_mtp") {
if(resolvePathCase(blfile).isEmpty())
blfile = RbSettings::value(RbSettings::Mountpoint).toString()
+ RbSettings::value(RbSettings::CurBootloaderName).toString()
.replace("H10", "H10EMP", Qt::CaseInsensitive);
QStringList blfile = RbSettings::value(RbSettings::CurBootloaderFile).toStringList();
QStringList blfilepath;
for(int a = 0; a < blfile.size(); a++) {
blfilepath.append(RbSettings::value(RbSettings::Mountpoint).toString()
+ blfile.at(a));
}
bl->setBlFile(blfile);
bl->setBlFile(blfilepath);
connect(bl, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int)));
connect(bl, SIGNAL(logProgress(int, int)), logger, SLOT(setProgress(int, int)));