diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-05-01 10:09:14 +0200 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-05-01 10:49:48 +0200 |
commit | 92ef7bd3289a5c4d15bd0de6fb8950af4036891b (patch) | |
tree | 70cd94f5908325da884d7093488002206941ba5e /rbutil/rbutilqt/rbutilqt.cpp | |
parent | 0dd200b33a624131190b0cffffb00a1cf4f7fd41 (diff) | |
download | rockbox-92ef7bd3289a5c4d15bd0de6fb8950af4036891b.tar.gz rockbox-92ef7bd3289a5c4d15bd0de6fb8950af4036891b.zip |
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
Diffstat (limited to 'rbutil/rbutilqt/rbutilqt.cpp')
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp index 4836cf567d..683f17c0af 100644 --- a/rbutil/rbutilqt/rbutilqt.cpp +++ b/rbutil/rbutilqt/rbutilqt.cpp | |||
@@ -44,7 +44,7 @@ | |||
44 | #include "progressloggerinterface.h" | 44 | #include "progressloggerinterface.h" |
45 | 45 | ||
46 | #include "bootloaderinstallbase.h" | 46 | #include "bootloaderinstallbase.h" |
47 | #include "bootloaderinstallmpio.h" | 47 | #include "bootloaderinstallhelper.h" |
48 | 48 | ||
49 | #if defined(Q_OS_LINUX) | 49 | #if defined(Q_OS_LINUX) |
50 | #include <stdio.h> | 50 | #include <stdio.h> |
@@ -673,8 +673,9 @@ void RbUtilQt::installBootloader() | |||
673 | m_error = false; | 673 | m_error = false; |
674 | 674 | ||
675 | // create installer | 675 | // create installer |
676 | BootloaderInstallBase *bl = BootloaderInstallBase::createBootloaderInstaller(this, | 676 | BootloaderInstallBase *bl = |
677 | SystemInfo::value(SystemInfo::CurBootloaderMethod).toString()); | 677 | BootloaderInstallHelper::createBootloaderInstaller(this, |
678 | SystemInfo::value(SystemInfo::CurBootloaderMethod).toString()); | ||
678 | if(bl == NULL) { | 679 | if(bl == NULL) { |
679 | logger->addItem(tr("No install method known."), LOGERROR); | 680 | logger->addItem(tr("No install method known."), LOGERROR); |
680 | logger->setFinished(); | 681 | logger->setFinished(); |
@@ -806,7 +807,7 @@ void RbUtilQt::installBootloaderPost(bool error) | |||
806 | if(m_auto) | 807 | if(m_auto) |
807 | return; | 808 | return; |
808 | 809 | ||
809 | QString msg = BootloaderInstallBase::postinstallHints( | 810 | QString msg = BootloaderInstallHelper::postinstallHints( |
810 | RbSettings::value(RbSettings::Platform).toString()); | 811 | RbSettings::value(RbSettings::Platform).toString()); |
811 | if(!msg.isEmpty()) { | 812 | if(!msg.isEmpty()) { |
812 | QMessageBox::information(this, tr("Manual steps required"), msg); | 813 | QMessageBox::information(this, tr("Manual steps required"), msg); |
@@ -1048,10 +1049,11 @@ void RbUtilQt::uninstallBootloader(void) | |||
1048 | QString platform = RbSettings::value(RbSettings::Platform).toString(); | 1049 | QString platform = RbSettings::value(RbSettings::Platform).toString(); |
1049 | 1050 | ||
1050 | // create installer | 1051 | // create installer |
1051 | BootloaderInstallBase *bl = BootloaderInstallBase::createBootloaderInstaller(this, | 1052 | BootloaderInstallBase *bl |
1052 | SystemInfo::value(SystemInfo::CurBootloaderMethod).toString()); | 1053 | = BootloaderInstallHelper::createBootloaderInstaller(this, |
1054 | SystemInfo::value(SystemInfo::CurBootloaderMethod).toString()); | ||
1053 | 1055 | ||
1054 | if(bl == NULL ) { | 1056 | if(bl == NULL) { |
1055 | logger->addItem(tr("No uninstall method for this target known."), LOGERROR); | 1057 | logger->addItem(tr("No uninstall method for this target known."), LOGERROR); |
1056 | logger->setFinished(); | 1058 | logger->setFinished(); |
1057 | return; | 1059 | return; |