summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/base/bootloaderinstallmi4.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilqt/base/bootloaderinstallmi4.cpp')
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallmi4.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/rbutil/rbutilqt/base/bootloaderinstallmi4.cpp b/rbutil/rbutilqt/base/bootloaderinstallmi4.cpp
index 8bce8212a9..e4722fda23 100644
--- a/rbutil/rbutilqt/base/bootloaderinstallmi4.cpp
+++ b/rbutil/rbutilqt/base/bootloaderinstallmi4.cpp
@@ -21,6 +21,7 @@
21#include <QtDebug> 21#include <QtDebug>
22#include "bootloaderinstallmi4.h" 22#include "bootloaderinstallmi4.h"
23#include "utils.h" 23#include "utils.h"
24#include "Logger.h"
24 25
25BootloaderInstallMi4::BootloaderInstallMi4(QObject *parent) 26BootloaderInstallMi4::BootloaderInstallMi4(QObject *parent)
26 : BootloaderInstallBase(parent) 27 : BootloaderInstallBase(parent)
@@ -31,7 +32,7 @@ BootloaderInstallMi4::BootloaderInstallMi4(QObject *parent)
31bool BootloaderInstallMi4::install(void) 32bool BootloaderInstallMi4::install(void)
32{ 33{
33 emit logItem(tr("Downloading bootloader"), LOGINFO); 34 emit logItem(tr("Downloading bootloader"), LOGINFO);
34 qDebug() << "[BootloaderInstallMi4] installing bootloader"; 35 LOG_INFO() << "installing bootloader";
35 downloadBlStart(m_blurl); 36 downloadBlStart(m_blurl);
36 connect(this, SIGNAL(downloadDone()), this, SLOT(installStage2())); 37 connect(this, SIGNAL(downloadDone()), this, SLOT(installStage2()));
37 return true; 38 return true;
@@ -48,18 +49,18 @@ void BootloaderInstallMi4::installStage2(void)
48 QString moved = QFileInfo(Utils::resolvePathCase(m_blfile)).absolutePath() 49 QString moved = QFileInfo(Utils::resolvePathCase(m_blfile)).absolutePath()
49 + "/OF.mi4"; 50 + "/OF.mi4";
50 if(!QFileInfo(moved).exists()) { 51 if(!QFileInfo(moved).exists()) {
51 qDebug() << "[BootloaderInstallMi4] renaming" << fwfile << "to" << moved; 52 LOG_INFO() << "renaming" << fwfile << "to" << moved;
52 oldbl.rename(moved); 53 oldbl.rename(moved);
53 } 54 }
54 else { 55 else {
55 qDebug() << "[BootloaderInstallMi4] OF.mi4 already present, not renaming again."; 56 LOG_INFO() << "OF.mi4 already present, not renaming again.";
56 oldbl.remove(); 57 oldbl.remove();
57 } 58 }
58 59
59 // place new bootloader 60 // place new bootloader
60 m_tempfile.open(); 61 m_tempfile.open();
61 qDebug() << "[BootloaderInstallMi4] renaming" << m_tempfile.fileName() 62 LOG_INFO() << "renaming" << m_tempfile.fileName()
62 << "to" << fwfile; 63 << "to" << fwfile;
63 m_tempfile.close(); 64 m_tempfile.close();
64 if(!Utils::resolvePathCase(fwfile).isEmpty()) { 65 if(!Utils::resolvePathCase(fwfile).isEmpty()) {
65 emit logItem(tr("A firmware file is already present on player"), LOGERROR); 66 emit logItem(tr("A firmware file is already present on player"), LOGERROR);
@@ -84,7 +85,7 @@ void BootloaderInstallMi4::installStage2(void)
84 85
85bool BootloaderInstallMi4::uninstall(void) 86bool BootloaderInstallMi4::uninstall(void)
86{ 87{
87 qDebug() << "[BootloaderInstallMi4] Uninstalling bootloader"; 88 LOG_INFO() << "Uninstalling bootloader";
88 89
89 // check if it's actually a Rockbox bootloader 90 // check if it's actually a Rockbox bootloader
90 emit logItem(tr("Checking for Rockbox bootloader"), LOGINFO); 91 emit logItem(tr("Checking for Rockbox bootloader"), LOGINFO);
@@ -128,7 +129,7 @@ BootloaderInstallBase::BootloaderType BootloaderInstallMi4::installed(void)
128 QString resolved; 129 QString resolved;
129 resolved = Utils::resolvePathCase(m_blfile); 130 resolved = Utils::resolvePathCase(m_blfile);
130 if(resolved.isEmpty()) { 131 if(resolved.isEmpty()) {
131 qDebug() << "[BootloaderInstallMi4] installed: BootloaderNone"; 132 LOG_INFO() << "installed: BootloaderNone";
132 return BootloaderNone; 133 return BootloaderNone;
133 } 134 }
134 135
@@ -140,11 +141,11 @@ BootloaderInstallBase::BootloaderType BootloaderInstallMi4::installed(void)
140 f.close(); 141 f.close();
141 142
142 if(!memcmp(magic, "RBBL", 4)) { 143 if(!memcmp(magic, "RBBL", 4)) {
143 qDebug() << "[BootloaderInstallMi4] installed: BootloaderRockbox"; 144 LOG_INFO() << "installed: BootloaderRockbox";
144 return BootloaderRockbox; 145 return BootloaderRockbox;
145 } 146 }
146 else { 147 else {
147 qDebug() << "[BootloaderInstallMi4] installed: BootloaderOther"; 148 LOG_INFO() << "installed: BootloaderOther";
148 return BootloaderOther; 149 return BootloaderOther;
149 } 150 }
150} 151}
@@ -152,7 +153,7 @@ BootloaderInstallBase::BootloaderType BootloaderInstallMi4::installed(void)
152 153
153BootloaderInstallBase::Capabilities BootloaderInstallMi4::capabilities(void) 154BootloaderInstallBase::Capabilities BootloaderInstallMi4::capabilities(void)
154{ 155{
155 qDebug() << "[BootloaderInstallMi4] getting capabilities"; 156 LOG_INFO() << "getting capabilities";
156 return Install | Uninstall | Backup | IsFile | CanCheckInstalled | CanCheckVersion; 157 return Install | Uninstall | Backup | IsFile | CanCheckInstalled | CanCheckVersion;
157} 158}
158 159