summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/base/bootloaderinstallbase.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2013-11-03 11:08:18 +0100
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2013-11-04 23:32:52 +0100
commit4d2ce949b3b41f8bf0af446fa20205ddd229e579 (patch)
tree01fa19471d9831b296bea5d7049f765e38b30bbb /rbutil/rbutilqt/base/bootloaderinstallbase.cpp
parent335ec75d60bba82f23fc47b20f9390e0cba9c9c5 (diff)
downloadrockbox-4d2ce949b3b41f8bf0af446fa20205ddd229e579.tar.gz
rockbox-4d2ce949b3b41f8bf0af446fa20205ddd229e579.zip
Use cutelogger for Rockbox Utility internal trace.
Change tracing from qDebug() to use cutelogger, which is available under the LGPL2.1. This allows to automatically add filename and line number to the log, and also provides multiple log levels. Change-Id: I5dbdaf902ba54ea99f07ae10a07467c52fdac910
Diffstat (limited to 'rbutil/rbutilqt/base/bootloaderinstallbase.cpp')
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallbase.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/rbutil/rbutilqt/base/bootloaderinstallbase.cpp b/rbutil/rbutilqt/base/bootloaderinstallbase.cpp
index 1a47f967b0..9a1c74c690 100644
--- a/rbutil/rbutilqt/base/bootloaderinstallbase.cpp
+++ b/rbutil/rbutilqt/base/bootloaderinstallbase.cpp
@@ -23,6 +23,7 @@
23#include "utils.h" 23#include "utils.h"
24#include "ziputil.h" 24#include "ziputil.h"
25#include "mspackutil.h" 25#include "mspackutil.h"
26#include "Logger.h"
26 27
27#if defined(Q_OS_MACX) 28#if defined(Q_OS_MACX)
28#include <sys/param.h> 29#include <sys/param.h>
@@ -58,8 +59,8 @@ void BootloaderInstallBase::downloadBlStart(QUrl source)
58 59
59void BootloaderInstallBase::downloadReqFinished(int id, bool error) 60void BootloaderInstallBase::downloadReqFinished(int id, bool error)
60{ 61{
61 qDebug() << "[BootloaderInstallBase] Download Request" << id 62 LOG_INFO() << "Download Request" << id
62 << "finished, error:" << m_http.errorString(); 63 << "finished, error:" << m_http.errorString();
63 64
64 downloadBlFinish(error); 65 downloadBlFinish(error);
65} 66}
@@ -67,8 +68,8 @@ void BootloaderInstallBase::downloadReqFinished(int id, bool error)
67 68
68void BootloaderInstallBase::downloadBlFinish(bool error) 69void BootloaderInstallBase::downloadBlFinish(bool error)
69{ 70{
70 qDebug() << "[BootloaderInstallBase] Downloading bootloader finished, error:" 71 LOG_INFO() << "Downloading bootloader finished, error:"
71 << error; 72 << error;
72 73
73 // update progress bar 74 // update progress bar
74 emit logProgress(100, 100); 75 emit logProgress(100, 100);
@@ -98,7 +99,7 @@ void BootloaderInstallBase::downloadBlFinish(bool error)
98 99
99void BootloaderInstallBase::installBlfile(void) 100void BootloaderInstallBase::installBlfile(void)
100{ 101{
101 qDebug() << "[BootloaderInstallBase] installBlFile(void)"; 102 LOG_INFO() << "installBlFile(void)";
102} 103}
103 104
104 105
@@ -107,7 +108,7 @@ void BootloaderInstallBase::installBlfile(void)
107//! @return true on success, false on error. 108//! @return true on success, false on error.
108bool BootloaderInstallBase::backup(QString to) 109bool BootloaderInstallBase::backup(QString to)
109{ 110{
110 qDebug() << "[BootloaderInstallBase] Backing up bootloader file"; 111 LOG_INFO() << "Backing up bootloader file";
111 QDir targetDir("."); 112 QDir targetDir(".");
112 emit logItem(tr("Creating backup of original firmware file."), LOGINFO); 113 emit logItem(tr("Creating backup of original firmware file."), LOGINFO);
113 if(!targetDir.mkpath(to)) { 114 if(!targetDir.mkpath(to)) {
@@ -115,7 +116,7 @@ bool BootloaderInstallBase::backup(QString to)
115 return false; 116 return false;
116 } 117 }
117 QString tofile = to + "/" + QFileInfo(m_blfile).fileName(); 118 QString tofile = to + "/" + QFileInfo(m_blfile).fileName();
118 qDebug() << "[BootloaderInstallBase] trying to backup" << m_blfile << "to" << tofile; 119 LOG_INFO() << "trying to backup" << m_blfile << "to" << tofile;
119 if(!QFile::copy(Utils::resolvePathCase(m_blfile), tofile)) { 120 if(!QFile::copy(Utils::resolvePathCase(m_blfile), tofile)) {
120 emit logItem(tr("Creating backup copy failed."), LOGERROR); 121 emit logItem(tr("Creating backup copy failed."), LOGERROR);
121 return false; 122 return false;
@@ -137,8 +138,8 @@ int BootloaderInstallBase::logInstall(LogMode mode)
137 138
138 if(mode == LogAdd) { 139 if(mode == LogAdd) {
139 s.setValue("Bootloader/" + section, m_blversion.toString(Qt::ISODate)); 140 s.setValue("Bootloader/" + section, m_blversion.toString(Qt::ISODate));
140 qDebug() << "[BootloaderInstallBase] Writing log, version:" 141 LOG_INFO() << "Writing log, version:"
141 << m_blversion.toString(Qt::ISODate); 142 << m_blversion.toString(Qt::ISODate);
142 } 143 }
143 else { 144 else {
144 s.remove("Bootloader/" + section); 145 s.remove("Bootloader/" + section);
@@ -182,7 +183,7 @@ void BootloaderInstallBase::checkRemount()
182 if(!status) { 183 if(!status) {
183 // still not remounted, restart timer. 184 // still not remounted, restart timer.
184 QTimer::singleShot(500, this, SLOT(checkRemount())); 185 QTimer::singleShot(500, this, SLOT(checkRemount()));
185 qDebug() << "[BootloaderInstallBase] Player not remounted yet" << m_remountDevice; 186 LOG_INFO() << "Player not remounted yet" << m_remountDevice;
186 } 187 }
187 else { 188 else {
188 emit logItem(tr("Player remounted"), LOGINFO); 189 emit logItem(tr("Player remounted"), LOGINFO);
@@ -244,11 +245,11 @@ bool BootloaderInstallBase::setOfFile(QString of, QStringList blfile)
244 // check if the file set is in zip format 245 // check if the file set is in zip format
245 if(util) { 246 if(util) {
246 QStringList contents = util->files(); 247 QStringList contents = util->files();
247 qDebug() << "[BootloaderInstallBase] archive contains:" << contents; 248 LOG_INFO() << "archive contains:" << contents;
248 for(int i = 0; i < blfile.size(); ++i) { 249 for(int i = 0; i < blfile.size(); ++i) {
249 // strip any path, we don't know the structure in the zip 250 // strip any path, we don't know the structure in the zip
250 QString f = QFileInfo(blfile.at(i)).fileName(); 251 QString f = QFileInfo(blfile.at(i)).fileName();
251 qDebug() << "[BootloaderInstallBase] searching archive for" << f; 252 LOG_INFO() << "searching archive for" << f;
252 // contents.indexOf() works case sensitive. Since the filename 253 // contents.indexOf() works case sensitive. Since the filename
253 // casing is unknown (and might change) do this manually. 254 // casing is unknown (and might change) do this manually.
254 // FIXME: support files in folders 255 // FIXME: support files in folders