mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 05:05:20 -05:00
Move bootloader class initialiation into helper.
Create a BootloaderInstallHelper class for handling post installation hints and creating the installation instance depending on the player model. This removes the base class handling its derived classes which always has been weird, and removes the need to change the base class when adding a new installation method, since the base shouldn't be affected. Change-Id: I2a156d70fd1cff6c48bdd46d10c33d75c953ea90
This commit is contained in:
parent
0dd200b33a
commit
92ef7bd328
5 changed files with 183 additions and 117 deletions
|
|
@ -44,7 +44,7 @@
|
|||
#include "progressloggerinterface.h"
|
||||
|
||||
#include "bootloaderinstallbase.h"
|
||||
#include "bootloaderinstallmpio.h"
|
||||
#include "bootloaderinstallhelper.h"
|
||||
|
||||
#if defined(Q_OS_LINUX)
|
||||
#include <stdio.h>
|
||||
|
|
@ -673,8 +673,9 @@ void RbUtilQt::installBootloader()
|
|||
m_error = false;
|
||||
|
||||
// create installer
|
||||
BootloaderInstallBase *bl = BootloaderInstallBase::createBootloaderInstaller(this,
|
||||
SystemInfo::value(SystemInfo::CurBootloaderMethod).toString());
|
||||
BootloaderInstallBase *bl =
|
||||
BootloaderInstallHelper::createBootloaderInstaller(this,
|
||||
SystemInfo::value(SystemInfo::CurBootloaderMethod).toString());
|
||||
if(bl == NULL) {
|
||||
logger->addItem(tr("No install method known."), LOGERROR);
|
||||
logger->setFinished();
|
||||
|
|
@ -806,7 +807,7 @@ void RbUtilQt::installBootloaderPost(bool error)
|
|||
if(m_auto)
|
||||
return;
|
||||
|
||||
QString msg = BootloaderInstallBase::postinstallHints(
|
||||
QString msg = BootloaderInstallHelper::postinstallHints(
|
||||
RbSettings::value(RbSettings::Platform).toString());
|
||||
if(!msg.isEmpty()) {
|
||||
QMessageBox::information(this, tr("Manual steps required"), msg);
|
||||
|
|
@ -1048,10 +1049,11 @@ void RbUtilQt::uninstallBootloader(void)
|
|||
QString platform = RbSettings::value(RbSettings::Platform).toString();
|
||||
|
||||
// create installer
|
||||
BootloaderInstallBase *bl = BootloaderInstallBase::createBootloaderInstaller(this,
|
||||
SystemInfo::value(SystemInfo::CurBootloaderMethod).toString());
|
||||
BootloaderInstallBase *bl
|
||||
= BootloaderInstallHelper::createBootloaderInstaller(this,
|
||||
SystemInfo::value(SystemInfo::CurBootloaderMethod).toString());
|
||||
|
||||
if(bl == NULL ) {
|
||||
if(bl == NULL) {
|
||||
logger->addItem(tr("No uninstall method for this target known."), LOGERROR);
|
||||
logger->setFinished();
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue