diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2013-11-03 11:08:18 +0100 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2013-11-04 23:32:52 +0100 |
commit | 4d2ce949b3b41f8bf0af446fa20205ddd229e579 (patch) | |
tree | 01fa19471d9831b296bea5d7049f765e38b30bbb /rbutil/rbutilqt/base | |
parent | 335ec75d60bba82f23fc47b20f9390e0cba9c9c5 (diff) | |
download | rockbox-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')
33 files changed, 324 insertions, 289 deletions
diff --git a/rbutil/rbutilqt/base/autodetection.cpp b/rbutil/rbutilqt/base/autodetection.cpp index 4b3d1a1ab1..1253202e40 100644 --- a/rbutil/rbutilqt/base/autodetection.cpp +++ b/rbutil/rbutilqt/base/autodetection.cpp | |||
@@ -28,6 +28,7 @@ | |||
28 | #include "system.h" | 28 | #include "system.h" |
29 | #include "utils.h" | 29 | #include "utils.h" |
30 | #include "rockboxinfo.h" | 30 | #include "rockboxinfo.h" |
31 | #include "Logger.h" | ||
31 | 32 | ||
32 | Autodetection::Autodetection(QObject* parent): QObject(parent) | 33 | Autodetection::Autodetection(QObject* parent): QObject(parent) |
33 | { | 34 | { |
@@ -67,8 +68,8 @@ bool Autodetection::detect(void) | |||
67 | } | 68 | } |
68 | } | 69 | } |
69 | for(int i = 0; i < m_detected.size(); ++i) { | 70 | for(int i = 0; i < m_detected.size(); ++i) { |
70 | qDebug() << "[Autodetect] Detected player:" << m_detected.at(i).device | 71 | LOG_INFO() << "Detected player:" << m_detected.at(i).device |
71 | << "at" << m_detected.at(i).mountpoint << states[m_detected.at(i).status]; | 72 | << "at" << m_detected.at(i).mountpoint << states[m_detected.at(i).status]; |
72 | } | 73 | } |
73 | 74 | ||
74 | return m_detected.size() > 0; | 75 | return m_detected.size() > 0; |
@@ -98,14 +99,14 @@ void Autodetection::detectUsb() | |||
98 | d.status = PlayerOk; | 99 | d.status = PlayerOk; |
99 | d.usbdevices = usbids.value(attached.at(i)); | 100 | d.usbdevices = usbids.value(attached.at(i)); |
100 | m_detected.append(d); | 101 | m_detected.append(d); |
101 | qDebug() << "[USB] detected supported player" << d.usbdevices; | 102 | LOG_INFO() << "[USB] detected supported player" << d.usbdevices; |
102 | } | 103 | } |
103 | if(usberror.contains(attached.at(i))) { | 104 | if(usberror.contains(attached.at(i))) { |
104 | struct Detected d; | 105 | struct Detected d; |
105 | d.status = PlayerMtpMode; | 106 | d.status = PlayerMtpMode; |
106 | d.device = usbids.value(attached.at(i)).at(0); | 107 | d.device = usbids.value(attached.at(i)).at(0); |
107 | m_detected.append(d); | 108 | m_detected.append(d); |
108 | qDebug() << "[USB] detected problem with player" << d.device; | 109 | LOG_WARNING() << "[USB] detected problem with player" << d.device; |
109 | } | 110 | } |
110 | QString idstring = QString("%1").arg(attached.at(i), 8, 16, QChar('0')); | 111 | QString idstring = QString("%1").arg(attached.at(i), 8, 16, QChar('0')); |
111 | if(!SystemInfo::platformValue(idstring, SystemInfo::CurName).toString().isEmpty()) { | 112 | if(!SystemInfo::platformValue(idstring, SystemInfo::CurName).toString().isEmpty()) { |
@@ -113,7 +114,7 @@ void Autodetection::detectUsb() | |||
113 | d.status = PlayerIncompatible; | 114 | d.status = PlayerIncompatible; |
114 | d.device = idstring; | 115 | d.device = idstring; |
115 | m_detected.append(d); | 116 | m_detected.append(d); |
116 | qDebug() << "[USB] detected incompatible player" << d.device; | 117 | LOG_WARNING() << "[USB] detected incompatible player" << d.device; |
117 | } | 118 | } |
118 | } | 119 | } |
119 | } | 120 | } |
@@ -125,7 +126,7 @@ void Autodetection::detectUsb() | |||
125 | void Autodetection::mergeMounted(void) | 126 | void Autodetection::mergeMounted(void) |
126 | { | 127 | { |
127 | QStringList mounts = Utils::mountpoints(Utils::MountpointsSupported); | 128 | QStringList mounts = Utils::mountpoints(Utils::MountpointsSupported); |
128 | qDebug() << "[Autodetect] paths to check:" << mounts; | 129 | LOG_INFO() << "paths to check:" << mounts; |
129 | 130 | ||
130 | for(int i = 0; i < mounts.size(); i++) | 131 | for(int i = 0; i < mounts.size(); i++) |
131 | { | 132 | { |
@@ -143,8 +144,8 @@ void Autodetection::mergeMounted(void) | |||
143 | d.mountpoint = mounts.at(i); | 144 | d.mountpoint = mounts.at(i); |
144 | d.status = PlayerOk; | 145 | d.status = PlayerOk; |
145 | updateDetectedDevice(d); | 146 | updateDetectedDevice(d); |
146 | qDebug() << "[Autodetect] rbutil.log detected:" | 147 | LOG_INFO() << "rbutil.log detected:" |
147 | << log.value("platform").toString() << mounts.at(i); | 148 | << log.value("platform").toString() << mounts.at(i); |
148 | } | 149 | } |
149 | } | 150 | } |
150 | 151 | ||
@@ -157,8 +158,8 @@ void Autodetection::mergeMounted(void) | |||
157 | d.mountpoint = mounts.at(i); | 158 | d.mountpoint = mounts.at(i); |
158 | d.status = PlayerOk; | 159 | d.status = PlayerOk; |
159 | updateDetectedDevice(d); | 160 | updateDetectedDevice(d); |
160 | qDebug() << "[Autodetect] rockbox-info.txt detected:" | 161 | LOG_INFO() << "rockbox-info.txt detected:" |
161 | << info.target() << mounts.at(i); | 162 | << info.target() << mounts.at(i); |
162 | } | 163 | } |
163 | 164 | ||
164 | // check for some specific files in root folder | 165 | // check for some specific files in root folder |
@@ -193,13 +194,13 @@ void Autodetection::mergeMounted(void) | |||
193 | } | 194 | } |
194 | if(rootentries.contains("ajbrec.ajz", Qt::CaseInsensitive)) | 195 | if(rootentries.contains("ajbrec.ajz", Qt::CaseInsensitive)) |
195 | { | 196 | { |
196 | qDebug() << "[Autodetect] ajbrec.ajz found. Trying detectAjbrec()"; | 197 | LOG_INFO() << "ajbrec.ajz found. Trying detectAjbrec()"; |
197 | struct Detected d; | 198 | struct Detected d; |
198 | d.device = detectAjbrec(mounts.at(i)); | 199 | d.device = detectAjbrec(mounts.at(i)); |
199 | d.mountpoint = mounts.at(i); | 200 | d.mountpoint = mounts.at(i); |
200 | d.status = PlayerOk; | 201 | d.status = PlayerOk; |
201 | if(!d.device.isEmpty()) { | 202 | if(!d.device.isEmpty()) { |
202 | qDebug() << "[Autodetect]" << d.device; | 203 | LOG_INFO() << d.device; |
203 | updateDetectedDevice(d); | 204 | updateDetectedDevice(d); |
204 | } | 205 | } |
205 | } | 206 | } |
@@ -255,7 +256,7 @@ void Autodetection::mergePatcher(void) | |||
255 | n = ipod_scan(&ipod); | 256 | n = ipod_scan(&ipod); |
256 | // FIXME: handle more than one Ipod connected in ipodpatcher. | 257 | // FIXME: handle more than one Ipod connected in ipodpatcher. |
257 | if(n == 1) { | 258 | if(n == 1) { |
258 | qDebug() << "[Autodetect] Ipod found:" << ipod.modelstr << "at" << ipod.diskname; | 259 | LOG_INFO() << "Ipod found:" << ipod.modelstr << "at" << ipod.diskname; |
259 | // since resolveMountPoint is doing exact matches we need to select | 260 | // since resolveMountPoint is doing exact matches we need to select |
260 | // the correct partition. | 261 | // the correct partition. |
261 | QString mp(ipod.diskname); | 262 | QString mp(ipod.diskname); |
@@ -276,7 +277,7 @@ void Autodetection::mergePatcher(void) | |||
276 | updateDetectedDevice(d); | 277 | updateDetectedDevice(d); |
277 | } | 278 | } |
278 | else { | 279 | else { |
279 | qDebug() << "[Autodetect] ipodpatcher: no Ipod found." << n; | 280 | LOG_INFO() << "ipodpatcher: no Ipod found." << n; |
280 | } | 281 | } |
281 | ipod_dealloc_buffer(&ipod); | 282 | ipod_dealloc_buffer(&ipod); |
282 | 283 | ||
@@ -286,8 +287,8 @@ void Autodetection::mergePatcher(void) | |||
286 | sansa_alloc_buffer(&sansa, BUFFER_SIZE); | 287 | sansa_alloc_buffer(&sansa, BUFFER_SIZE); |
287 | n = sansa_scan(&sansa); | 288 | n = sansa_scan(&sansa); |
288 | if(n == 1) { | 289 | if(n == 1) { |
289 | qDebug() << "[Autodetect] Sansa found:" | 290 | LOG_INFO() << "Sansa found:" |
290 | << sansa.targetname << "at" << sansa.diskname; | 291 | << sansa.targetname << "at" << sansa.diskname; |
291 | QString mp(sansa.diskname); | 292 | QString mp(sansa.diskname); |
292 | #ifdef Q_OS_LINUX | 293 | #ifdef Q_OS_LINUX |
293 | mp.append("1"); | 294 | mp.append("1"); |
@@ -302,7 +303,7 @@ void Autodetection::mergePatcher(void) | |||
302 | updateDetectedDevice(d); | 303 | updateDetectedDevice(d); |
303 | } | 304 | } |
304 | else { | 305 | else { |
305 | qDebug() << "[Autodetect] sansapatcher: no Sansa found." << n; | 306 | LOG_INFO() << "sansapatcher: no Sansa found." << n; |
306 | } | 307 | } |
307 | sansa_dealloc_buffer(&sansa); | 308 | sansa_dealloc_buffer(&sansa); |
308 | } | 309 | } |
@@ -323,8 +324,8 @@ QString Autodetection::detectAjbrec(QString root) | |||
323 | // recorder v1 has the binary length in the first 4 bytes, so check | 324 | // recorder v1 has the binary length in the first 4 bytes, so check |
324 | // for them first. | 325 | // for them first. |
325 | int len = (header[0]<<24) | (header[1]<<16) | (header[2]<<8) | header[3]; | 326 | int len = (header[0]<<24) | (header[1]<<16) | (header[2]<<8) | header[3]; |
326 | qDebug() << "[Autodetect] ABJREC possible bin length:" << len | 327 | LOG_INFO() << "abjrec.ajz possible bin length:" << len |
327 | << "file len:" << f.size(); | 328 | << "file len:" << f.size(); |
328 | if((f.size() - 6) == len) | 329 | if((f.size() - 6) == len) |
329 | return "recorder"; | 330 | return "recorder"; |
330 | 331 | ||
diff --git a/rbutil/rbutilqt/base/bootloaderinstallams.cpp b/rbutil/rbutilqt/base/bootloaderinstallams.cpp index dbdac8e2ce..33ad51c200 100644 --- a/rbutil/rbutilqt/base/bootloaderinstallams.cpp +++ b/rbutil/rbutilqt/base/bootloaderinstallams.cpp | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <QtCore> | 19 | #include <QtCore> |
20 | #include "bootloaderinstallbase.h" | 20 | #include "bootloaderinstallbase.h" |
21 | #include "bootloaderinstallams.h" | 21 | #include "bootloaderinstallams.h" |
22 | #include "Logger.h" | ||
22 | 23 | ||
23 | #include "../mkamsboot/mkamsboot.h" | 24 | #include "../mkamsboot/mkamsboot.h" |
24 | 25 | ||
@@ -51,7 +52,7 @@ bool BootloaderInstallAms::install(void) | |||
51 | if(m_offile.isEmpty()) | 52 | if(m_offile.isEmpty()) |
52 | return false; | 53 | return false; |
53 | 54 | ||
54 | qDebug() << "[BootloaderInstallAms] installing bootloader"; | 55 | LOG_INFO() << "installing bootloader"; |
55 | 56 | ||
56 | // download firmware from server | 57 | // download firmware from server |
57 | emit logItem(tr("Downloading bootloader file"), LOGINFO); | 58 | emit logItem(tr("Downloading bootloader file"), LOGINFO); |
@@ -64,7 +65,7 @@ bool BootloaderInstallAms::install(void) | |||
64 | 65 | ||
65 | void BootloaderInstallAms::installStage2(void) | 66 | void BootloaderInstallAms::installStage2(void) |
66 | { | 67 | { |
67 | qDebug() << "[BootloaderInstallAms] installStage2"; | 68 | LOG_INFO() << "installStage2"; |
68 | 69 | ||
69 | unsigned char* buf; | 70 | unsigned char* buf; |
70 | unsigned char* of_packed; | 71 | unsigned char* of_packed; |
@@ -94,7 +95,7 @@ void BootloaderInstallAms::installStage2(void) | |||
94 | errstr,sizeof(errstr)); | 95 | errstr,sizeof(errstr)); |
95 | if (rb_packed == NULL) | 96 | if (rb_packed == NULL) |
96 | { | 97 | { |
97 | qDebug() << "[BootloaderInstallAms] could not load bootloader: " << bootfile; | 98 | LOG_ERROR() << "could not load bootloader: " << bootfile; |
98 | emit logItem(errstr, LOGERROR); | 99 | emit logItem(errstr, LOGERROR); |
99 | emit logItem(tr("Could not load %1").arg(bootfile), LOGERROR); | 100 | emit logItem(tr("Could not load %1").arg(bootfile), LOGERROR); |
100 | emit done(true); | 101 | emit done(true); |
@@ -107,7 +108,7 @@ void BootloaderInstallAms::installStage2(void) | |||
107 | errstr, sizeof(errstr)); | 108 | errstr, sizeof(errstr)); |
108 | if (buf == NULL) | 109 | if (buf == NULL) |
109 | { | 110 | { |
110 | qDebug() << "[BootloaderInstallAms] could not load OF: " << m_offile; | 111 | LOG_ERROR() << "could not load OF: " << m_offile; |
111 | emit logItem(errstr, LOGERROR); | 112 | emit logItem(errstr, LOGERROR); |
112 | emit logItem(tr("Could not load %1").arg(m_offile), LOGERROR); | 113 | emit logItem(tr("Could not load %1").arg(m_offile), LOGERROR); |
113 | free(rb_packed); | 114 | free(rb_packed); |
@@ -121,7 +122,7 @@ void BootloaderInstallAms::installStage2(void) | |||
121 | 122 | ||
122 | if (!patchable) | 123 | if (!patchable) |
123 | { | 124 | { |
124 | qDebug() << "[BootloaderInstallAms] No room to insert bootloader"; | 125 | LOG_ERROR() << "No room to insert bootloader"; |
125 | emit logItem(errstr, LOGERROR); | 126 | emit logItem(errstr, LOGERROR); |
126 | emit logItem(tr("No room to insert bootloader, try another firmware version"), | 127 | emit logItem(tr("No room to insert bootloader, try another firmware version"), |
127 | LOGERROR); | 128 | LOGERROR); |
@@ -143,7 +144,7 @@ void BootloaderInstallAms::installStage2(void) | |||
143 | 144 | ||
144 | if(!out.open(QIODevice::WriteOnly | QIODevice::Truncate)) | 145 | if(!out.open(QIODevice::WriteOnly | QIODevice::Truncate)) |
145 | { | 146 | { |
146 | qDebug() << "[BootloaderInstallAms] Could not open" << m_blfile << "for writing"; | 147 | LOG_ERROR() << "Could not open" << m_blfile << "for writing"; |
147 | emit logItem(tr("Could not open %1 for writing").arg(m_blfile),LOGERROR); | 148 | emit logItem(tr("Could not open %1 for writing").arg(m_blfile),LOGERROR); |
148 | free(buf); | 149 | free(buf); |
149 | free(of_packed); | 150 | free(of_packed); |
@@ -156,7 +157,7 @@ void BootloaderInstallAms::installStage2(void) | |||
156 | 157 | ||
157 | if (n != len) | 158 | if (n != len) |
158 | { | 159 | { |
159 | qDebug() << "[BootloaderInstallAms] Could not write firmware file"; | 160 | LOG_ERROR() << "Could not write firmware file"; |
160 | emit logItem(tr("Could not write firmware file"),LOGERROR); | 161 | emit logItem(tr("Could not write firmware file"),LOGERROR); |
161 | free(buf); | 162 | free(buf); |
162 | free(of_packed); | 163 | free(of_packed); |
@@ -172,7 +173,7 @@ void BootloaderInstallAms::installStage2(void) | |||
172 | free(rb_packed); | 173 | free(rb_packed); |
173 | 174 | ||
174 | //end of install | 175 | //end of install |
175 | qDebug() << "[BootloaderInstallAms] install successfull"; | 176 | LOG_INFO() << "install successfull"; |
176 | emit logItem(tr("Success: modified firmware file created"), LOGINFO); | 177 | emit logItem(tr("Success: modified firmware file created"), LOGINFO); |
177 | logInstall(LogAdd); | 178 | logInstall(LogAdd); |
178 | emit done(false); | 179 | emit done(false); |
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 | ||
59 | void BootloaderInstallBase::downloadReqFinished(int id, bool error) | 60 | void 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 | ||
68 | void BootloaderInstallBase::downloadBlFinish(bool error) | 69 | void 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 | ||
99 | void BootloaderInstallBase::installBlfile(void) | 100 | void 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. |
108 | bool BootloaderInstallBase::backup(QString to) | 109 | bool 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 |
diff --git a/rbutil/rbutilqt/base/bootloaderinstallfile.cpp b/rbutil/rbutilqt/base/bootloaderinstallfile.cpp index fc293e54eb..70867b8868 100644 --- a/rbutil/rbutilqt/base/bootloaderinstallfile.cpp +++ b/rbutil/rbutilqt/base/bootloaderinstallfile.cpp | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <QtDebug> | 20 | #include <QtDebug> |
21 | #include "bootloaderinstallfile.h" | 21 | #include "bootloaderinstallfile.h" |
22 | #include "utils.h" | 22 | #include "utils.h" |
23 | #include "Logger.h" | ||
23 | 24 | ||
24 | 25 | ||
25 | BootloaderInstallFile::BootloaderInstallFile(QObject *parent) | 26 | BootloaderInstallFile::BootloaderInstallFile(QObject *parent) |
@@ -31,7 +32,7 @@ BootloaderInstallFile::BootloaderInstallFile(QObject *parent) | |||
31 | bool BootloaderInstallFile::install(void) | 32 | bool BootloaderInstallFile::install(void) |
32 | { | 33 | { |
33 | emit logItem(tr("Downloading bootloader"), LOGINFO); | 34 | emit logItem(tr("Downloading bootloader"), LOGINFO); |
34 | qDebug() << "[BootloaderInstallFile] 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; |
@@ -46,7 +47,7 @@ void BootloaderInstallFile::installStage2(void) | |||
46 | QString fwfile(Utils::resolvePathCase(m_blfile)); | 47 | QString fwfile(Utils::resolvePathCase(m_blfile)); |
47 | if(!fwfile.isEmpty()) { | 48 | if(!fwfile.isEmpty()) { |
48 | QString moved = Utils::resolvePathCase(m_blfile) + ".ORIG"; | 49 | QString moved = Utils::resolvePathCase(m_blfile) + ".ORIG"; |
49 | qDebug() << "[BootloaderInstallFile] renaming" << fwfile << "to" << moved; | 50 | LOG_INFO() << "renaming" << fwfile << "to" << moved; |
50 | QFile::rename(fwfile, moved); | 51 | QFile::rename(fwfile, moved); |
51 | } | 52 | } |
52 | 53 | ||
@@ -80,8 +81,8 @@ void BootloaderInstallFile::installStage2(void) | |||
80 | 81 | ||
81 | // place (new) bootloader | 82 | // place (new) bootloader |
82 | m_tempfile.open(); | 83 | m_tempfile.open(); |
83 | qDebug() << "[BootloaderInstallFile] renaming" << m_tempfile.fileName() | 84 | LOG_INFO() << "renaming" << m_tempfile.fileName() |
84 | << "to" << fwfile; | 85 | << "to" << fwfile; |
85 | m_tempfile.close(); | 86 | m_tempfile.close(); |
86 | 87 | ||
87 | if(!Utils::resolvePathCase(fwfile).isEmpty()) { | 88 | if(!Utils::resolvePathCase(fwfile).isEmpty()) { |
@@ -106,7 +107,7 @@ void BootloaderInstallFile::installStage2(void) | |||
106 | 107 | ||
107 | bool BootloaderInstallFile::uninstall(void) | 108 | bool BootloaderInstallFile::uninstall(void) |
108 | { | 109 | { |
109 | qDebug() << "[BootloaderInstallFile] Uninstalling bootloader"; | 110 | LOG_INFO() << "Uninstalling bootloader"; |
110 | emit logItem(tr("Removing Rockbox bootloader"), LOGINFO); | 111 | emit logItem(tr("Removing Rockbox bootloader"), LOGINFO); |
111 | // check if a .ORIG file is present, and allow moving it back. | 112 | // check if a .ORIG file is present, and allow moving it back. |
112 | QString origbl = Utils::resolvePathCase(m_blfile + ".ORIG"); | 113 | QString origbl = Utils::resolvePathCase(m_blfile + ".ORIG"); |
@@ -138,7 +139,7 @@ bool BootloaderInstallFile::uninstall(void) | |||
138 | //! @return BootloaderRockbox, BootloaderOther or BootloaderUnknown. | 139 | //! @return BootloaderRockbox, BootloaderOther or BootloaderUnknown. |
139 | BootloaderInstallBase::BootloaderType BootloaderInstallFile::installed(void) | 140 | BootloaderInstallBase::BootloaderType BootloaderInstallFile::installed(void) |
140 | { | 141 | { |
141 | qDebug() << "[BootloaderInstallFile] checking installed bootloader"; | 142 | LOG_INFO() << "checking installed bootloader"; |
142 | if(!Utils::resolvePathCase(m_blfile).isEmpty() | 143 | if(!Utils::resolvePathCase(m_blfile).isEmpty() |
143 | && !Utils::resolvePathCase(m_blfile + ".ORIG").isEmpty()) | 144 | && !Utils::resolvePathCase(m_blfile + ".ORIG").isEmpty()) |
144 | return BootloaderRockbox; | 145 | return BootloaderRockbox; |
@@ -151,7 +152,7 @@ BootloaderInstallBase::BootloaderType BootloaderInstallFile::installed(void) | |||
151 | 152 | ||
152 | BootloaderInstallBase::Capabilities BootloaderInstallFile::capabilities(void) | 153 | BootloaderInstallBase::Capabilities BootloaderInstallFile::capabilities(void) |
153 | { | 154 | { |
154 | qDebug() << "[BootloaderInstallFile] getting capabilities"; | 155 | LOG_INFO() << "getting capabilities"; |
155 | return Install | Uninstall | IsFile | CanCheckInstalled | Backup; | 156 | return Install | Uninstall | IsFile | CanCheckInstalled | Backup; |
156 | } | 157 | } |
157 | 158 | ||
diff --git a/rbutil/rbutilqt/base/bootloaderinstallhex.cpp b/rbutil/rbutilqt/base/bootloaderinstallhex.cpp index 506a05522a..39a2392731 100644 --- a/rbutil/rbutilqt/base/bootloaderinstallhex.cpp +++ b/rbutil/rbutilqt/base/bootloaderinstallhex.cpp | |||
@@ -20,6 +20,7 @@ | |||
20 | #include "bootloaderinstallbase.h" | 20 | #include "bootloaderinstallbase.h" |
21 | #include "bootloaderinstallhex.h" | 21 | #include "bootloaderinstallhex.h" |
22 | #include "utils.h" | 22 | #include "utils.h" |
23 | #include "Logger.h" | ||
23 | 24 | ||
24 | #include "../../tools/iriver.h" | 25 | #include "../../tools/iriver.h" |
25 | #include "../../tools/mkboot.h" | 26 | #include "../../tools/mkboot.h" |
@@ -74,7 +75,7 @@ bool BootloaderInstallHex::install(void) | |||
74 | file.close(); | 75 | file.close(); |
75 | QString hash = QCryptographicHash::hash(filedata, | 76 | QString hash = QCryptographicHash::hash(filedata, |
76 | QCryptographicHash::Md5).toHex(); | 77 | QCryptographicHash::Md5).toHex(); |
77 | qDebug() << "[BootloaderInstallHex] hexfile hash:" << hash; | 78 | LOG_INFO() << "hexfile hash:" << hash; |
78 | if(file.error() != QFile::NoError) { | 79 | if(file.error() != QFile::NoError) { |
79 | emit logItem(tr("Could not verify original firmware file"), LOGERROR); | 80 | emit logItem(tr("Could not verify original firmware file"), LOGERROR); |
80 | emit done(true); | 81 | emit done(true); |
@@ -112,7 +113,7 @@ bool BootloaderInstallHex::install(void) | |||
112 | int result; | 113 | int result; |
113 | result = iriver_decode(m_offile.toLatin1().data(), | 114 | result = iriver_decode(m_offile.toLatin1().data(), |
114 | m_descrambled.fileName().toLatin1().data(), FALSE, STRIP_NONE); | 115 | m_descrambled.fileName().toLatin1().data(), FALSE, STRIP_NONE); |
115 | qDebug() << "[BootloaderInstallHex] iriver_decode" << result; | 116 | LOG_INFO() << "iriver_decode():" << result; |
116 | 117 | ||
117 | if(result < 0) { | 118 | if(result < 0) { |
118 | emit logItem(tr("Error in descramble: %1").arg(scrambleError(result)), LOGERROR); | 119 | emit logItem(tr("Error in descramble: %1").arg(scrambleError(result)), LOGERROR); |
@@ -200,7 +201,7 @@ void BootloaderInstallHex::installStage2(void) | |||
200 | targethex.close(); | 201 | targethex.close(); |
201 | QString hash = QCryptographicHash::hash(filedata, | 202 | QString hash = QCryptographicHash::hash(filedata, |
202 | QCryptographicHash::Md5).toHex(); | 203 | QCryptographicHash::Md5).toHex(); |
203 | qDebug() << "[BootloaderInstallHex] created hexfile hash:" << hash; | 204 | LOG_INFO() << "created hexfile hash:" << hash; |
204 | 205 | ||
205 | emit logItem(tr("Checking modified firmware file"), LOGINFO); | 206 | emit logItem(tr("Checking modified firmware file"), LOGINFO); |
206 | if(hash != QString(md5sums[m_hashindex].patched)) { | 207 | if(hash != QString(md5sums[m_hashindex].patched)) { |
diff --git a/rbutil/rbutilqt/base/bootloaderinstallimx.cpp b/rbutil/rbutilqt/base/bootloaderinstallimx.cpp index e12849e856..74c6f94f78 100644 --- a/rbutil/rbutilqt/base/bootloaderinstallimx.cpp +++ b/rbutil/rbutilqt/base/bootloaderinstallimx.cpp | |||
@@ -21,6 +21,7 @@ | |||
21 | #include "bootloaderinstallbase.h" | 21 | #include "bootloaderinstallbase.h" |
22 | #include "bootloaderinstallimx.h" | 22 | #include "bootloaderinstallimx.h" |
23 | #include "../mkimxboot/mkimxboot.h" | 23 | #include "../mkimxboot/mkimxboot.h" |
24 | #include "Logger.h" | ||
24 | 25 | ||
25 | // class for running mkimxboot() in a separate thread to keep the UI responsive. | 26 | // class for running mkimxboot() in a separate thread to keep the UI responsive. |
26 | class BootloaderThreadImx : public QThread | 27 | class BootloaderThreadImx : public QThread |
@@ -45,7 +46,7 @@ class BootloaderThreadImx : public QThread | |||
45 | 46 | ||
46 | void BootloaderThreadImx::run(void) | 47 | void BootloaderThreadImx::run(void) |
47 | { | 48 | { |
48 | qDebug() << "[BootloaderThreadImx] Thread started."; | 49 | LOG_INFO() << "Thread started."; |
49 | struct imx_option_t opt; | 50 | struct imx_option_t opt; |
50 | memset(&opt, 0, sizeof(opt)); | 51 | memset(&opt, 0, sizeof(opt)); |
51 | opt.debug = false; | 52 | opt.debug = false; |
@@ -55,7 +56,7 @@ void BootloaderThreadImx::run(void) | |||
55 | m_error = mkimxboot(m_inputfile.toLocal8Bit().constData(), | 56 | m_error = mkimxboot(m_inputfile.toLocal8Bit().constData(), |
56 | m_bootfile.toLocal8Bit().constData(), | 57 | m_bootfile.toLocal8Bit().constData(), |
57 | m_outputfile.toLocal8Bit().constData(), opt); | 58 | m_outputfile.toLocal8Bit().constData(), opt); |
58 | qDebug() << "[BootloaderThreadImx] Thread finished, result:" << m_error; | 59 | LOG_INFO() << "Thread finished, result:" << m_error; |
59 | } | 60 | } |
60 | 61 | ||
61 | 62 | ||
@@ -88,13 +89,13 @@ bool BootloaderInstallImx::install(void) | |||
88 | { | 89 | { |
89 | if(!QFileInfo(m_offile).isReadable()) | 90 | if(!QFileInfo(m_offile).isReadable()) |
90 | { | 91 | { |
91 | qDebug() << "[BootloaderInstallImx] could not read original firmware file" | 92 | LOG_ERROR() << "could not read original firmware file" |
92 | << m_offile; | 93 | << m_offile; |
93 | emit logItem(tr("Could not read original firmware file"), LOGERROR); | 94 | emit logItem(tr("Could not read original firmware file"), LOGERROR); |
94 | return false; | 95 | return false; |
95 | } | 96 | } |
96 | 97 | ||
97 | qDebug() << "[BootloaderInstallImx] downloading bootloader"; | 98 | LOG_INFO() << "downloading bootloader"; |
98 | // download bootloader from server | 99 | // download bootloader from server |
99 | emit logItem(tr("Downloading bootloader file"), LOGINFO); | 100 | emit logItem(tr("Downloading bootloader file"), LOGINFO); |
100 | connect(this, SIGNAL(downloadDone()), this, SLOT(installStage2())); | 101 | connect(this, SIGNAL(downloadDone()), this, SLOT(installStage2())); |
@@ -105,7 +106,7 @@ bool BootloaderInstallImx::install(void) | |||
105 | 106 | ||
106 | void BootloaderInstallImx::installStage2(void) | 107 | void BootloaderInstallImx::installStage2(void) |
107 | { | 108 | { |
108 | qDebug() << "[BootloaderInstallImx] patching file..."; | 109 | LOG_INFO() << "patching file..."; |
109 | emit logItem(tr("Patching file..."), LOGINFO); | 110 | emit logItem(tr("Patching file..."), LOGINFO); |
110 | m_tempfile.open(); | 111 | m_tempfile.open(); |
111 | 112 | ||
@@ -132,26 +133,26 @@ void BootloaderInstallImx::installStage3(void) | |||
132 | // if the patch failed | 133 | // if the patch failed |
133 | if (err != IMX_SUCCESS) | 134 | if (err != IMX_SUCCESS) |
134 | { | 135 | { |
135 | qDebug() << "[BootloaderInstallImx] Could not patch the original firmware file"; | 136 | LOG_ERROR() << "Could not patch the original firmware file"; |
136 | emit logItem(tr("Patching the original firmware failed"), LOGERROR); | 137 | emit logItem(tr("Patching the original firmware failed"), LOGERROR); |
137 | emit done(true); | 138 | emit done(true); |
138 | return; | 139 | return; |
139 | } | 140 | } |
140 | 141 | ||
141 | qDebug() << "[BootloaderInstallImx] Original Firmware succesfully patched"; | 142 | LOG_INFO() << "Original Firmware succesfully patched"; |
142 | emit logItem(tr("Succesfully patched firmware file"), LOGINFO); | 143 | emit logItem(tr("Succesfully patched firmware file"), LOGINFO); |
143 | 144 | ||
144 | // if a bootloader is already present delete it. | 145 | // if a bootloader is already present delete it. |
145 | QString fwfile(m_blfile); | 146 | QString fwfile(m_blfile); |
146 | if(QFileInfo(fwfile).isFile()) | 147 | if(QFileInfo(fwfile).isFile()) |
147 | { | 148 | { |
148 | qDebug() << "[BootloaderInstallImx] deleting old target file"; | 149 | LOG_INFO() << "deleting old target file"; |
149 | QFile::remove(fwfile); | 150 | QFile::remove(fwfile); |
150 | } | 151 | } |
151 | 152 | ||
152 | // place (new) bootloader. Copy, since the temporary file will be removed | 153 | // place (new) bootloader. Copy, since the temporary file will be removed |
153 | // automatically. | 154 | // automatically. |
154 | qDebug() << "[BootloaderInstallImx] moving patched bootloader to" << fwfile; | 155 | LOG_INFO() << "moving patched bootloader to" << fwfile; |
155 | if(m_patchedFile.copy(fwfile)) | 156 | if(m_patchedFile.copy(fwfile)) |
156 | { | 157 | { |
157 | emit logItem(tr("Bootloader successful installed"), LOGOK); | 158 | emit logItem(tr("Bootloader successful installed"), LOGOK); |
diff --git a/rbutil/rbutilqt/base/bootloaderinstallipod.cpp b/rbutil/rbutilqt/base/bootloaderinstallipod.cpp index de7aaa897b..6c23bc200f 100644 --- a/rbutil/rbutilqt/base/bootloaderinstallipod.cpp +++ b/rbutil/rbutilqt/base/bootloaderinstallipod.cpp | |||
@@ -22,6 +22,7 @@ | |||
22 | 22 | ||
23 | #include "../ipodpatcher/ipodpatcher.h" | 23 | #include "../ipodpatcher/ipodpatcher.h" |
24 | #include "utils.h" | 24 | #include "utils.h" |
25 | #include "Logger.h" | ||
25 | 26 | ||
26 | 27 | ||
27 | BootloaderInstallIpod::BootloaderInstallIpod(QObject *parent) | 28 | BootloaderInstallIpod::BootloaderInstallIpod(QObject *parent) |
@@ -131,7 +132,8 @@ void BootloaderInstallIpod::installStage3(bool mounted) | |||
131 | emit logItem(tr("Writing log aborted"), LOGERROR); | 132 | emit logItem(tr("Writing log aborted"), LOGERROR); |
132 | emit done(true); | 133 | emit done(true); |
133 | } | 134 | } |
134 | qDebug() << "[BootloaderInstallIpod] version installed:" << m_blversion.toString(Qt::ISODate); | 135 | LOG_INFO() << "version installed:" |
136 | << m_blversion.toString(Qt::ISODate); | ||
135 | } | 137 | } |
136 | 138 | ||
137 | 139 | ||
@@ -190,7 +192,7 @@ BootloaderInstallBase::BootloaderType BootloaderInstallIpod::installed(void) | |||
190 | BootloaderInstallBase::BootloaderType result = BootloaderRockbox; | 192 | BootloaderInstallBase::BootloaderType result = BootloaderRockbox; |
191 | 193 | ||
192 | if(!ipodInitialize(&ipod)) { | 194 | if(!ipodInitialize(&ipod)) { |
193 | qDebug() << "[BootloaderInstallIpod] installed: BootloaderUnknown"; | 195 | LOG_INFO() << "installed: BootloaderUnknown"; |
194 | result = BootloaderUnknown; | 196 | result = BootloaderUnknown; |
195 | } | 197 | } |
196 | else { | 198 | else { |
@@ -200,7 +202,7 @@ BootloaderInstallBase::BootloaderType BootloaderInstallIpod::installed(void) | |||
200 | result = BootloaderOther; | 202 | result = BootloaderOther; |
201 | } | 203 | } |
202 | else { | 204 | else { |
203 | qDebug() << "[BootloaderInstallIpod] installed: BootloaderRockbox"; | 205 | LOG_INFO() << "installed: BootloaderRockbox"; |
204 | } | 206 | } |
205 | } | 207 | } |
206 | ipod_close(&ipod); | 208 | ipod_close(&ipod); |
@@ -235,12 +237,12 @@ bool BootloaderInstallIpod::ipodInitialize(struct ipod_t *ipod) | |||
235 | sprintf(ipod->diskname, "%s", | 237 | sprintf(ipod->diskname, "%s", |
236 | qPrintable(devicename.remove(QRegExp("[0-9]+$")))); | 238 | qPrintable(devicename.remove(QRegExp("[0-9]+$")))); |
237 | #endif | 239 | #endif |
238 | qDebug() << "[BootloaderInstallIpod] ipodpatcher: overriding scan, using" | 240 | LOG_INFO() << "ipodpatcher: overriding scan, using" |
239 | << ipod->diskname; | 241 | << ipod->diskname; |
240 | } | 242 | } |
241 | else { | 243 | else { |
242 | emit logItem(tr("Error: no mountpoint specified!"), LOGERROR); | 244 | emit logItem(tr("Error: no mountpoint specified!"), LOGERROR); |
243 | qDebug() << "[BootloaderInstallIpod] no mountpoint specified!"; | 245 | LOG_ERROR() << "no mountpoint specified!"; |
244 | } | 246 | } |
245 | int result = ipod_open(ipod, 1); | 247 | int result = ipod_open(ipod, 1); |
246 | if(result == -2) { | 248 | if(result == -2) { |
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 | ||
25 | BootloaderInstallMi4::BootloaderInstallMi4(QObject *parent) | 26 | BootloaderInstallMi4::BootloaderInstallMi4(QObject *parent) |
26 | : BootloaderInstallBase(parent) | 27 | : BootloaderInstallBase(parent) |
@@ -31,7 +32,7 @@ BootloaderInstallMi4::BootloaderInstallMi4(QObject *parent) | |||
31 | bool BootloaderInstallMi4::install(void) | 32 | bool 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 | ||
85 | bool BootloaderInstallMi4::uninstall(void) | 86 | bool 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 | ||
153 | BootloaderInstallBase::Capabilities BootloaderInstallMi4::capabilities(void) | 154 | BootloaderInstallBase::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 | ||
diff --git a/rbutil/rbutilqt/base/bootloaderinstallmpio.cpp b/rbutil/rbutilqt/base/bootloaderinstallmpio.cpp index 52a6f351f1..97b68f7f61 100644 --- a/rbutil/rbutilqt/base/bootloaderinstallmpio.cpp +++ b/rbutil/rbutilqt/base/bootloaderinstallmpio.cpp | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <QtCore> | 20 | #include <QtCore> |
21 | #include "bootloaderinstallbase.h" | 21 | #include "bootloaderinstallbase.h" |
22 | #include "bootloaderinstallmpio.h" | 22 | #include "bootloaderinstallmpio.h" |
23 | #include "Logger.h" | ||
23 | 24 | ||
24 | #include "../mkmpioboot/mkmpioboot.h" | 25 | #include "../mkmpioboot/mkmpioboot.h" |
25 | 26 | ||
@@ -46,7 +47,7 @@ bool BootloaderInstallMpio::install(void) | |||
46 | if(m_offile.isEmpty()) | 47 | if(m_offile.isEmpty()) |
47 | return false; | 48 | return false; |
48 | 49 | ||
49 | qDebug() << "[BootloaderInstallMpio] installing bootloader"; | 50 | LOG_INFO() << "installing bootloader"; |
50 | 51 | ||
51 | // download firmware from server | 52 | // download firmware from server |
52 | emit logItem(tr("Downloading bootloader file"), LOGINFO); | 53 | emit logItem(tr("Downloading bootloader file"), LOGINFO); |
@@ -59,7 +60,7 @@ bool BootloaderInstallMpio::install(void) | |||
59 | 60 | ||
60 | void BootloaderInstallMpio::installStage2(void) | 61 | void BootloaderInstallMpio::installStage2(void) |
61 | { | 62 | { |
62 | qDebug() << "[BootloaderInstallMpio] installStage2"; | 63 | LOG_INFO() << "installStage2"; |
63 | 64 | ||
64 | int origin = 0xe0000; /* MPIO HD200 bootloader address */ | 65 | int origin = 0xe0000; /* MPIO HD200 bootloader address */ |
65 | 66 | ||
@@ -107,14 +108,14 @@ void BootloaderInstallMpio::installStage2(void) | |||
107 | break; | 108 | break; |
108 | } | 109 | } |
109 | 110 | ||
110 | qDebug() << "[BootloaderInstallMpio] Patching original firmware failed:" << error; | 111 | LOG_ERROR() << "Patching original firmware failed:" << error; |
111 | emit logItem(tr("Patching original firmware failed: %1").arg(error), LOGERROR); | 112 | emit logItem(tr("Patching original firmware failed: %1").arg(error), LOGERROR); |
112 | emit done(true); | 113 | emit done(true); |
113 | return; | 114 | return; |
114 | } | 115 | } |
115 | 116 | ||
116 | //end of install | 117 | //end of install |
117 | qDebug() << "[BootloaderInstallMpio] install successful"; | 118 | LOG_INFO() << "install successful"; |
118 | emit logItem(tr("Success: modified firmware file created"), LOGINFO); | 119 | emit logItem(tr("Success: modified firmware file created"), LOGINFO); |
119 | logInstall(LogAdd); | 120 | logInstall(LogAdd); |
120 | emit done(false); | 121 | emit done(false); |
diff --git a/rbutil/rbutilqt/base/bootloaderinstallsansa.cpp b/rbutil/rbutilqt/base/bootloaderinstallsansa.cpp index 49099ebaf8..d722dfdf6e 100644 --- a/rbutil/rbutilqt/base/bootloaderinstallsansa.cpp +++ b/rbutil/rbutilqt/base/bootloaderinstallsansa.cpp | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <QtCore> | 19 | #include <QtCore> |
20 | #include "bootloaderinstallbase.h" | 20 | #include "bootloaderinstallbase.h" |
21 | #include "bootloaderinstallsansa.h" | 21 | #include "bootloaderinstallsansa.h" |
22 | #include "Logger.h" | ||
22 | 23 | ||
23 | #include "../sansapatcher/sansapatcher.h" | 24 | #include "../sansapatcher/sansapatcher.h" |
24 | #include "utils.h" | 25 | #include "utils.h" |
@@ -116,7 +117,7 @@ void BootloaderInstallSansa::installStage2(void) | |||
116 | m_tempfile.close(); | 117 | m_tempfile.close(); |
117 | if(memcmp(sansa.targetname, magic, 4) != 0) { | 118 | if(memcmp(sansa.targetname, magic, 4) != 0) { |
118 | emit logItem(tr("Bootloader mismatch! Aborting."), LOGERROR); | 119 | emit logItem(tr("Bootloader mismatch! Aborting."), LOGERROR); |
119 | qDebug("[BootloaderInstallSansa] Targetname: %s, mi4 magic: %c%c%c%c", | 120 | LOG_INFO("Targetname: %s, mi4 magic: %c%c%c%c", |
120 | sansa.targetname, magic[0], magic[1], magic[2], magic[3]); | 121 | sansa.targetname, magic[0], magic[1], magic[2], magic[3]); |
121 | emit done(true); | 122 | emit done(true); |
122 | sansa_close(&sansa); | 123 | sansa_close(&sansa); |
@@ -157,7 +158,8 @@ void BootloaderInstallSansa::installStage3(bool mounted) | |||
157 | emit logItem(tr("Writing log aborted"), LOGERROR); | 158 | emit logItem(tr("Writing log aborted"), LOGERROR); |
158 | emit done(true); | 159 | emit done(true); |
159 | } | 160 | } |
160 | qDebug() << "[BootloaderInstallSansa] version installed:" << m_blversion.toString(Qt::ISODate); | 161 | LOG_INFO() << "version installed:" |
162 | << m_blversion.toString(Qt::ISODate); | ||
161 | } | 163 | } |
162 | 164 | ||
163 | 165 | ||
@@ -245,8 +247,8 @@ bool BootloaderInstallSansa::sansaInitialize(struct sansa_t *sansa) | |||
245 | sprintf(sansa->diskname, | 247 | sprintf(sansa->diskname, |
246 | qPrintable(devicename.remove(QRegExp("[0-9]+$")))); | 248 | qPrintable(devicename.remove(QRegExp("[0-9]+$")))); |
247 | #endif | 249 | #endif |
248 | qDebug() << "[BootloaderInstallSansa] sansapatcher: overriding scan, using" | 250 | LOG_INFO() << "sansapatcher: overriding scan, using" |
249 | << sansa->diskname; | 251 | << sansa->diskname; |
250 | } | 252 | } |
251 | else if(sansa_scan(sansa) != 1) { | 253 | else if(sansa_scan(sansa) != 1) { |
252 | emit logItem(tr("Can't find Sansa"), LOGERROR); | 254 | emit logItem(tr("Can't find Sansa"), LOGERROR); |
diff --git a/rbutil/rbutilqt/base/encoderexe.cpp b/rbutil/rbutilqt/base/encoderexe.cpp index f0f39daad7..f56cf368eb 100644 --- a/rbutil/rbutilqt/base/encoderexe.cpp +++ b/rbutil/rbutilqt/base/encoderexe.cpp | |||
@@ -20,6 +20,7 @@ | |||
20 | #include "encoderexe.h" | 20 | #include "encoderexe.h" |
21 | #include "rbsettings.h" | 21 | #include "rbsettings.h" |
22 | #include "utils.h" | 22 | #include "utils.h" |
23 | #include "Logger.h" | ||
23 | 24 | ||
24 | EncoderExe::EncoderExe(QString name,QObject *parent) : EncoderBase(parent) | 25 | EncoderExe::EncoderExe(QString name,QObject *parent) : EncoderBase(parent) |
25 | { | 26 | { |
@@ -69,14 +70,13 @@ bool EncoderExe::start() | |||
69 | 70 | ||
70 | bool EncoderExe::encode(QString input,QString output) | 71 | bool EncoderExe::encode(QString input,QString output) |
71 | { | 72 | { |
72 | //qDebug() << "encoding.."; | ||
73 | QString execstring = m_EncTemplate; | 73 | QString execstring = m_EncTemplate; |
74 | 74 | ||
75 | execstring.replace("%exe",m_EncExec); | 75 | execstring.replace("%exe",m_EncExec); |
76 | execstring.replace("%options",m_EncOpts); | 76 | execstring.replace("%options",m_EncOpts); |
77 | execstring.replace("%input",input); | 77 | execstring.replace("%input",input); |
78 | execstring.replace("%output",output); | 78 | execstring.replace("%output",output); |
79 | qDebug() << "[EncoderExe] cmd: " << execstring; | 79 | LOG_INFO() << "cmd: " << execstring; |
80 | int result = QProcess::execute(execstring); | 80 | int result = QProcess::execute(execstring); |
81 | return (result == 0) ? true : false; | 81 | return (result == 0) ? true : false; |
82 | } | 82 | } |
diff --git a/rbutil/rbutilqt/base/encoderlame.cpp b/rbutil/rbutilqt/base/encoderlame.cpp index c8554194c4..ad283ccf9e 100644 --- a/rbutil/rbutilqt/base/encoderlame.cpp +++ b/rbutil/rbutilqt/base/encoderlame.cpp | |||
@@ -20,13 +20,14 @@ | |||
20 | #include "encoderlame.h" | 20 | #include "encoderlame.h" |
21 | #include "rbsettings.h" | 21 | #include "rbsettings.h" |
22 | #include "lame/lame.h" | 22 | #include "lame/lame.h" |
23 | #include "Logger.h" | ||
23 | 24 | ||
24 | /** Resolve a symbol from loaded library. | 25 | /** Resolve a symbol from loaded library. |
25 | */ | 26 | */ |
26 | #define SYMBOLRESOLVE(symbol, type) \ | 27 | #define SYMBOLRESOLVE(symbol, type) \ |
27 | do { m_##symbol = (type)lib->resolve(#symbol); \ | 28 | do { m_##symbol = (type)lib->resolve(#symbol); \ |
28 | if(!m_##symbol) return; \ | 29 | if(!m_##symbol) return; \ |
29 | qDebug() << "[EncoderLame] Resolved symbol " #symbol; } \ | 30 | LOG_INFO() << "Resolved symbol " #symbol; } \ |
30 | while(0) | 31 | while(0) |
31 | 32 | ||
32 | EncoderLame::EncoderLame(QObject *parent) : EncoderBase(parent) | 33 | EncoderLame::EncoderLame(QObject *parent) : EncoderBase(parent) |
@@ -50,7 +51,7 @@ EncoderLame::EncoderLame(QObject *parent) : EncoderBase(parent) | |||
50 | SYMBOLRESOLVE(lame_encode_flush, int (*)(lame_global_flags*, unsigned char*, int)); | 51 | SYMBOLRESOLVE(lame_encode_flush, int (*)(lame_global_flags*, unsigned char*, int)); |
51 | SYMBOLRESOLVE(lame_close, int (*)(lame_global_flags*)); | 52 | SYMBOLRESOLVE(lame_close, int (*)(lame_global_flags*)); |
52 | 53 | ||
53 | qDebug() << "[EncoderLame] libmp3lame loaded:" << lib->isLoaded(); | 54 | LOG_INFO() << "libmp3lame loaded:" << lib->isLoaded(); |
54 | 55 | ||
55 | m_encoderVolume = RbSettings::subValue("lame", RbSettings::EncoderVolume).toDouble(); | 56 | m_encoderVolume = RbSettings::subValue("lame", RbSettings::EncoderVolume).toDouble(); |
56 | m_encoderQuality = RbSettings::subValue("lame", RbSettings::EncoderQuality).toDouble(); | 57 | m_encoderQuality = RbSettings::subValue("lame", RbSettings::EncoderQuality).toDouble(); |
@@ -108,9 +109,9 @@ bool EncoderLame::start() | |||
108 | 109 | ||
109 | bool EncoderLame::encode(QString input,QString output) | 110 | bool EncoderLame::encode(QString input,QString output) |
110 | { | 111 | { |
111 | qDebug() << "[EncoderLame] Encoding" << QDir::cleanPath(input); | 112 | LOG_INFO() << "Encoding" << QDir::cleanPath(input); |
112 | if(!m_symbolsResolved) { | 113 | if(!m_symbolsResolved) { |
113 | qDebug() << "[EncoderLame] Symbols not successfully resolved, cannot run!"; | 114 | LOG_ERROR() << "Symbols not successfully resolved, cannot run!"; |
114 | return false; | 115 | return false; |
115 | } | 116 | } |
116 | 117 | ||
@@ -144,21 +145,21 @@ bool EncoderLame::encode(QString input,QString output) | |||
144 | m_lame_set_bWriteVbrTag(gfp, 0); // disable LAME tag. | 145 | m_lame_set_bWriteVbrTag(gfp, 0); // disable LAME tag. |
145 | 146 | ||
146 | if(!fin.open(QIODevice::ReadOnly)) { | 147 | if(!fin.open(QIODevice::ReadOnly)) { |
147 | qDebug() << "[EncoderLame] Could not open input file" << input; | 148 | LOG_ERROR() << "Could not open input file" << input; |
148 | return false; | 149 | return false; |
149 | } | 150 | } |
150 | 151 | ||
151 | // read RIFF header | 152 | // read RIFF header |
152 | fin.read((char*)header, 12); | 153 | fin.read((char*)header, 12); |
153 | if(memcmp("RIFF", header, 4) != 0) { | 154 | if(memcmp("RIFF", header, 4) != 0) { |
154 | qDebug() << "[EncoderLame] RIFF header not found!" | 155 | LOG_ERROR() << "RIFF header not found!" |
155 | << header[0] << header[1] << header[2] << header[3]; | 156 | << header[0] << header[1] << header[2] << header[3]; |
156 | fin.close(); | 157 | fin.close(); |
157 | return false; | 158 | return false; |
158 | } | 159 | } |
159 | if(memcmp("WAVE", &header[8], 4) != 0) { | 160 | if(memcmp("WAVE", &header[8], 4) != 0) { |
160 | qDebug() << "[EncoderLame] WAVE FOURCC not found!" | 161 | LOG_ERROR() << "WAVE FOURCC not found!" |
161 | << header[8] << header[9] << header[10] << header[11]; | 162 | << header[8] << header[9] << header[10] << header[11]; |
162 | fin.close(); | 163 | fin.close(); |
163 | return false; | 164 | return false; |
164 | } | 165 | } |
@@ -178,7 +179,7 @@ bool EncoderLame::encode(QString input,QString output) | |||
178 | // input format used should be known. In case some TTS uses a | 179 | // input format used should be known. In case some TTS uses a |
179 | // different wave encoding some time this needs to get adjusted. | 180 | // different wave encoding some time this needs to get adjusted. |
180 | if(chunkdatalen < 16) { | 181 | if(chunkdatalen < 16) { |
181 | qDebug() << "[EncoderLame] fmt chunk too small!"; | 182 | LOG_ERROR() << "fmt chunk too small!"; |
182 | } | 183 | } |
183 | else { | 184 | else { |
184 | unsigned char *buf = new unsigned char[chunkdatalen]; | 185 | unsigned char *buf = new unsigned char[chunkdatalen]; |
@@ -196,18 +197,18 @@ bool EncoderLame::encode(QString input,QString output) | |||
196 | } | 197 | } |
197 | else { | 198 | else { |
198 | // unknown chunk, just skip its data. | 199 | // unknown chunk, just skip its data. |
199 | qDebug() << "[EncoderLame] unknown chunk, skipping." | 200 | LOG_WARNING() << "unknown chunk, skipping." |
200 | << chunkheader[0] << chunkheader[1] | 201 | << chunkheader[0] << chunkheader[1] |
201 | << chunkheader[2] << chunkheader[3]; | 202 | << chunkheader[2] << chunkheader[3]; |
202 | fin.seek(fin.pos() + chunkdatalen); | 203 | fin.seek(fin.pos() + chunkdatalen); |
203 | } | 204 | } |
204 | } while(!fin.atEnd()); | 205 | } while(!fin.atEnd()); |
205 | 206 | ||
206 | // check format | 207 | // check format |
207 | if(channels == 0 || samplerate == 0 || samplesize == 0 || datalength == 0) { | 208 | if(channels == 0 || samplerate == 0 || samplesize == 0 || datalength == 0) { |
208 | qDebug() << "[EncoderLame] invalid format. Channels:" << channels | 209 | LOG_ERROR() << "invalid format. Channels:" << channels |
209 | << "Samplerate:" << samplerate << "Samplesize:" << samplesize | 210 | << "Samplerate:" << samplerate << "Samplesize:" << samplesize |
210 | << "Data chunk length:" << datalength; | 211 | << "Data chunk length:" << datalength; |
211 | fin.close(); | 212 | fin.close(); |
212 | return false; | 213 | return false; |
213 | } | 214 | } |
@@ -220,7 +221,7 @@ bool EncoderLame::encode(QString input,QString output) | |||
220 | // initialize encoder. | 221 | // initialize encoder. |
221 | ret = m_lame_init_params(gfp); | 222 | ret = m_lame_init_params(gfp); |
222 | if(ret != 0) { | 223 | if(ret != 0) { |
223 | qDebug() << "[EncoderLame] lame_init_params() failed with" << ret; | 224 | LOG_ERROR() << "lame_init_params() failed with" << ret; |
224 | fin.close(); | 225 | fin.close(); |
225 | return false; | 226 | return false; |
226 | } | 227 | } |
@@ -230,7 +231,7 @@ bool EncoderLame::encode(QString input,QString output) | |||
230 | // bytes the input file has. This wastes space but should be ok. | 231 | // bytes the input file has. This wastes space but should be ok. |
231 | // Put an upper limit of 8MiB. | 232 | // Put an upper limit of 8MiB. |
232 | if(datalength > 8*1024*1024) { | 233 | if(datalength > 8*1024*1024) { |
233 | qDebug() << "[EncoderLame] Input file too large:" << datalength; | 234 | LOG_ERROR() << "Input file too large:" << datalength; |
234 | fin.close(); | 235 | fin.close(); |
235 | return false; | 236 | return false; |
236 | } | 237 | } |
@@ -255,7 +256,7 @@ bool EncoderLame::encode(QString input,QString output) | |||
255 | } | 256 | } |
256 | } | 257 | } |
257 | else { | 258 | else { |
258 | qDebug() << "[EncoderLame] Unknown samplesize:" << samplesize; | 259 | LOG_ERROR() << "Unknown samplesize:" << samplesize; |
259 | fin.close(); | 260 | fin.close(); |
260 | delete[] mp3buf; | 261 | delete[] mp3buf; |
261 | delete[] wavbuf; | 262 | delete[] wavbuf; |
@@ -270,10 +271,10 @@ bool EncoderLame::encode(QString input,QString output) | |||
270 | fout.open(QIODevice::ReadWrite); | 271 | fout.open(QIODevice::ReadWrite); |
271 | ret = m_lame_encode_buffer(gfp, wavbuf, wavbuf, num_samples, mp3buf, mp3buflen); | 272 | ret = m_lame_encode_buffer(gfp, wavbuf, wavbuf, num_samples, mp3buf, mp3buflen); |
272 | if(ret < 0) { | 273 | if(ret < 0) { |
273 | qDebug() << "[EncoderLame] Error during encoding:" << ret; | 274 | LOG_ERROR() << "Error during encoding:" << ret; |
274 | } | 275 | } |
275 | if(fout.write((char*)mp3buf, ret) != (unsigned int)ret) { | 276 | if(fout.write((char*)mp3buf, ret) != (unsigned int)ret) { |
276 | qDebug() << "[EncoderLame] Writing mp3 data failed!" << ret; | 277 | LOG_ERROR() << "Writing mp3 data failed!" << ret; |
277 | fout.close(); | 278 | fout.close(); |
278 | delete[] mp3buf; | 279 | delete[] mp3buf; |
279 | delete[] wavbuf; | 280 | delete[] wavbuf; |
@@ -282,7 +283,7 @@ bool EncoderLame::encode(QString input,QString output) | |||
282 | // flush remaining data | 283 | // flush remaining data |
283 | ret = m_lame_encode_flush(gfp, mp3buf, mp3buflen); | 284 | ret = m_lame_encode_flush(gfp, mp3buf, mp3buflen); |
284 | if(fout.write((char*)mp3buf, ret) != (unsigned int)ret) { | 285 | if(fout.write((char*)mp3buf, ret) != (unsigned int)ret) { |
285 | qDebug() << "[EncoderLame] Writing final mp3 data failed!"; | 286 | LOG_ERROR() << "Writing final mp3 data failed!"; |
286 | fout.close(); | 287 | fout.close(); |
287 | delete[] mp3buf; | 288 | delete[] mp3buf; |
288 | delete[] wavbuf; | 289 | delete[] wavbuf; |
diff --git a/rbutil/rbutilqt/base/encoderrbspeex.cpp b/rbutil/rbutilqt/base/encoderrbspeex.cpp index a8b7555fa9..0fc0293685 100644 --- a/rbutil/rbutilqt/base/encoderrbspeex.cpp +++ b/rbutil/rbutilqt/base/encoderrbspeex.cpp | |||
@@ -20,6 +20,7 @@ | |||
20 | #include "encoderrbspeex.h" | 20 | #include "encoderrbspeex.h" |
21 | #include "rbsettings.h" | 21 | #include "rbsettings.h" |
22 | #include "rbspeex.h" | 22 | #include "rbspeex.h" |
23 | #include "Logger.h" | ||
23 | 24 | ||
24 | EncoderRbSpeex::EncoderRbSpeex(QObject *parent) : EncoderBase(parent) | 25 | EncoderRbSpeex::EncoderRbSpeex(QObject *parent) : EncoderBase(parent) |
25 | { | 26 | { |
@@ -78,16 +79,16 @@ bool EncoderRbSpeex::start() | |||
78 | 79 | ||
79 | bool EncoderRbSpeex::encode(QString input,QString output) | 80 | bool EncoderRbSpeex::encode(QString input,QString output) |
80 | { | 81 | { |
81 | qDebug() << "[RbSpeex] Encoding " << input << " to "<< output; | 82 | LOG_INFO() << "Encoding " << input << " to "<< output; |
82 | char errstr[512]; | 83 | char errstr[512]; |
83 | 84 | ||
84 | FILE *fin,*fout; | 85 | FILE *fin,*fout; |
85 | if ((fin = fopen(input.toLocal8Bit(), "rb")) == NULL) { | 86 | if ((fin = fopen(input.toLocal8Bit(), "rb")) == NULL) { |
86 | qDebug() << "[RbSpeex] Error: could not open input file\n"; | 87 | LOG_ERROR() << "Error: could not open input file\n"; |
87 | return false; | 88 | return false; |
88 | } | 89 | } |
89 | if ((fout = fopen(output.toLocal8Bit(), "wb")) == NULL) { | 90 | if ((fout = fopen(output.toLocal8Bit(), "wb")) == NULL) { |
90 | qDebug() << "[RbSpeex] Error: could not open output file\n"; | 91 | LOG_ERROR() << "Error: could not open output file\n"; |
91 | fclose(fin); | 92 | fclose(fin); |
92 | return false; | 93 | return false; |
93 | } | 94 | } |
@@ -99,7 +100,7 @@ bool EncoderRbSpeex::encode(QString input,QString output) | |||
99 | 100 | ||
100 | if (!ret) { | 101 | if (!ret) { |
101 | /* Attempt to delete unfinished output */ | 102 | /* Attempt to delete unfinished output */ |
102 | qDebug() << "[RbSpeex] Error:" << errstr; | 103 | LOG_ERROR() << "Error:" << errstr; |
103 | QFile(output).remove(); | 104 | QFile(output).remove(); |
104 | return false; | 105 | return false; |
105 | } | 106 | } |
diff --git a/rbutil/rbutilqt/base/httpget.cpp b/rbutil/rbutilqt/base/httpget.cpp index e6b9eb4d3c..4b08faf33b 100644 --- a/rbutil/rbutilqt/base/httpget.cpp +++ b/rbutil/rbutilqt/base/httpget.cpp | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <QNetworkRequest> | 23 | #include <QNetworkRequest> |
24 | 24 | ||
25 | #include "httpget.h" | 25 | #include "httpget.h" |
26 | #include "Logger.h" | ||
26 | 27 | ||
27 | QString HttpGet::m_globalUserAgent; //< globally set user agent for requests | 28 | QString HttpGet::m_globalUserAgent; //< globally set user agent for requests |
28 | QDir HttpGet::m_globalCache; //< global cach path value for new objects | 29 | QDir HttpGet::m_globalCache; //< global cach path value for new objects |
@@ -71,14 +72,14 @@ void HttpGet::setCache(bool c) | |||
71 | QString path = m_cachedir.absolutePath(); | 72 | QString path = m_cachedir.absolutePath(); |
72 | 73 | ||
73 | if(!c || m_cachedir.absolutePath().isEmpty()) { | 74 | if(!c || m_cachedir.absolutePath().isEmpty()) { |
74 | qDebug() << "[HttpGet] disabling download cache"; | 75 | LOG_INFO() << "disabling download cache"; |
75 | } | 76 | } |
76 | else { | 77 | else { |
77 | // append the cache path to make it unique in case the path points to | 78 | // append the cache path to make it unique in case the path points to |
78 | // the system temporary path. In that case using it directly might | 79 | // the system temporary path. In that case using it directly might |
79 | // cause problems. Extra path also used in configure dialog. | 80 | // cause problems. Extra path also used in configure dialog. |
80 | path += "/rbutil-cache"; | 81 | path += "/rbutil-cache"; |
81 | qDebug() << "[HttpGet] setting cache folder to" << path; | 82 | LOG_INFO() << "setting cache folder to" << path; |
82 | m_cache = new QNetworkDiskCache(this); | 83 | m_cache = new QNetworkDiskCache(this); |
83 | m_cache->setCacheDirectory(path); | 84 | m_cache->setCacheDirectory(path); |
84 | } | 85 | } |
@@ -97,7 +98,7 @@ QByteArray HttpGet::readAll() | |||
97 | 98 | ||
98 | void HttpGet::setProxy(const QUrl &proxy) | 99 | void HttpGet::setProxy(const QUrl &proxy) |
99 | { | 100 | { |
100 | qDebug() << "[HttpGet] Proxy set to" << proxy; | 101 | LOG_INFO() << "Proxy set to" << proxy; |
101 | m_proxy.setType(QNetworkProxy::HttpProxy); | 102 | m_proxy.setType(QNetworkProxy::HttpProxy); |
102 | m_proxy.setHostName(proxy.host()); | 103 | m_proxy.setHostName(proxy.host()); |
103 | m_proxy.setPort(proxy.port()); | 104 | m_proxy.setPort(proxy.port()); |
@@ -130,10 +131,10 @@ void HttpGet::requestFinished(QNetworkReply* reply) | |||
130 | { | 131 | { |
131 | m_lastStatusCode | 132 | m_lastStatusCode |
132 | = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); | 133 | = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); |
133 | qDebug() << "[HttpGet] Request finished, status code:" << m_lastStatusCode; | 134 | LOG_INFO() << "Request finished, status code:" << m_lastStatusCode; |
134 | m_lastServerTimestamp | 135 | m_lastServerTimestamp |
135 | = reply->header(QNetworkRequest::LastModifiedHeader).toDateTime().toLocalTime(); | 136 | = reply->header(QNetworkRequest::LastModifiedHeader).toDateTime().toLocalTime(); |
136 | qDebug() << "[HttpGet] Data from cache:" | 137 | LOG_INFO() << "Data from cache:" |
137 | << reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool(); | 138 | << reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool(); |
138 | m_lastRequestCached = | 139 | m_lastRequestCached = |
139 | reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool(); | 140 | reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool(); |
@@ -150,7 +151,7 @@ void HttpGet::requestFinished(QNetworkReply* reply) | |||
150 | #else | 151 | #else |
151 | url.setQuery(org.query()); | 152 | url.setQuery(org.query()); |
152 | #endif | 153 | #endif |
153 | qDebug() << "[HttpGet] Redirected to" << url; | 154 | LOG_INFO() << "Redirected to" << url; |
154 | startRequest(url); | 155 | startRequest(url); |
155 | return; | 156 | return; |
156 | } | 157 | } |
@@ -179,7 +180,7 @@ void HttpGet::downloadProgress(qint64 received, qint64 total) | |||
179 | 180 | ||
180 | void HttpGet::startRequest(QUrl url) | 181 | void HttpGet::startRequest(QUrl url) |
181 | { | 182 | { |
182 | qDebug() << "[HttpGet] Request started"; | 183 | LOG_INFO() << "Request started"; |
183 | QNetworkRequest req(url); | 184 | QNetworkRequest req(url); |
184 | if(!m_globalUserAgent.isEmpty()) | 185 | if(!m_globalUserAgent.isEmpty()) |
185 | req.setRawHeader("User-Agent", m_globalUserAgent.toLatin1()); | 186 | req.setRawHeader("User-Agent", m_globalUserAgent.toLatin1()); |
@@ -194,15 +195,14 @@ void HttpGet::startRequest(QUrl url) | |||
194 | 195 | ||
195 | void HttpGet::networkError(QNetworkReply::NetworkError error) | 196 | void HttpGet::networkError(QNetworkReply::NetworkError error) |
196 | { | 197 | { |
197 | qDebug() << "[HttpGet] NetworkError occured:" | 198 | LOG_ERROR() << "NetworkError occured:" << error << m_reply->errorString(); |
198 | << error << m_reply->errorString(); | ||
199 | m_lastErrorString = m_reply->errorString(); | 199 | m_lastErrorString = m_reply->errorString(); |
200 | } | 200 | } |
201 | 201 | ||
202 | 202 | ||
203 | bool HttpGet::getFile(const QUrl &url) | 203 | bool HttpGet::getFile(const QUrl &url) |
204 | { | 204 | { |
205 | qDebug() << "[HttpGet] Get URI" << url.toString(); | 205 | LOG_INFO() << "Get URI" << url.toString(); |
206 | m_data.clear(); | 206 | m_data.clear(); |
207 | startRequest(url); | 207 | startRequest(url); |
208 | 208 | ||
diff --git a/rbutil/rbutilqt/base/httpget.h b/rbutil/rbutilqt/base/httpget.h index 2f6448a40d..8c62157e5f 100644 --- a/rbutil/rbutilqt/base/httpget.h +++ b/rbutil/rbutilqt/base/httpget.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <QtCore> | 25 | #include <QtCore> |
26 | #include <QtNetwork> | 26 | #include <QtNetwork> |
27 | #include <QNetworkAccessManager> | 27 | #include <QNetworkAccessManager> |
28 | #include "Logger.h" | ||
28 | 29 | ||
29 | class HttpGet : public QObject | 30 | class HttpGet : public QObject |
30 | { | 31 | { |
@@ -49,13 +50,13 @@ class HttpGet : public QObject | |||
49 | //< set global cache path | 50 | //< set global cache path |
50 | static void setGlobalCache(const QDir& d) | 51 | static void setGlobalCache(const QDir& d) |
51 | { | 52 | { |
52 | qDebug() << "[HttpGet] Global cache set to" << d.absolutePath(); | 53 | LOG_INFO() << "Global cache set to" << d.absolutePath(); |
53 | m_globalCache = d; | 54 | m_globalCache = d; |
54 | } | 55 | } |
55 | //< set global proxy value | 56 | //< set global proxy value |
56 | static void setGlobalProxy(const QUrl& p) | 57 | static void setGlobalProxy(const QUrl& p) |
57 | { | 58 | { |
58 | qDebug() << "[HttpGet] setting global proxy" << p; | 59 | LOG_INFO() << "setting global proxy" << p; |
59 | if(!p.isValid() || p.isEmpty()) { | 60 | if(!p.isValid() || p.isEmpty()) { |
60 | HttpGet::m_globalProxy.setType(QNetworkProxy::NoProxy); | 61 | HttpGet::m_globalProxy.setType(QNetworkProxy::NoProxy); |
61 | } | 62 | } |
diff --git a/rbutil/rbutilqt/base/mspackutil.cpp b/rbutil/rbutilqt/base/mspackutil.cpp index 4bc7307cd9..1ee250cd6d 100644 --- a/rbutil/rbutilqt/base/mspackutil.cpp +++ b/rbutil/rbutilqt/base/mspackutil.cpp | |||
@@ -17,7 +17,7 @@ | |||
17 | ****************************************************************************/ | 17 | ****************************************************************************/ |
18 | 18 | ||
19 | #include <QtCore> | 19 | #include <QtCore> |
20 | #include <QDebug> | 20 | #include "Logger.h" |
21 | #include "mspackutil.h" | 21 | #include "mspackutil.h" |
22 | #include "progressloggerinterface.h" | 22 | #include "progressloggerinterface.h" |
23 | 23 | ||
@@ -27,7 +27,7 @@ MsPackUtil::MsPackUtil(QObject* parent) | |||
27 | m_cabd = mspack_create_cab_decompressor(NULL); | 27 | m_cabd = mspack_create_cab_decompressor(NULL); |
28 | m_cabinet = NULL; | 28 | m_cabinet = NULL; |
29 | if(!m_cabd) | 29 | if(!m_cabd) |
30 | qDebug() << "[MsPackUtil] CAB decompressor creation failed!"; | 30 | LOG_ERROR() << "CAB decompressor creation failed!"; |
31 | } | 31 | } |
32 | 32 | ||
33 | MsPackUtil::~MsPackUtil() | 33 | MsPackUtil::~MsPackUtil() |
@@ -43,7 +43,7 @@ bool MsPackUtil::open(QString& mspackfile) | |||
43 | 43 | ||
44 | if(m_cabd == NULL) | 44 | if(m_cabd == NULL) |
45 | { | 45 | { |
46 | qDebug() << "[MsPackUtil] No CAB decompressor available: cannot open file!"; | 46 | LOG_ERROR() << "No CAB decompressor available: cannot open file!"; |
47 | return false; | 47 | return false; |
48 | } | 48 | } |
49 | m_cabinet = m_cabd->search(m_cabd, QFile::encodeName(mspackfile).constData()); | 49 | m_cabinet = m_cabd->search(m_cabd, QFile::encodeName(mspackfile).constData()); |
@@ -60,10 +60,10 @@ bool MsPackUtil::close(void) | |||
60 | 60 | ||
61 | bool MsPackUtil::extractArchive(const QString& dest, QString file) | 61 | bool MsPackUtil::extractArchive(const QString& dest, QString file) |
62 | { | 62 | { |
63 | qDebug() << "[MsPackUtil] extractArchive" << dest << file; | 63 | LOG_INFO() << "extractArchive" << dest << file; |
64 | if(!m_cabinet) | 64 | if(!m_cabinet) |
65 | { | 65 | { |
66 | qDebug() << "[MsPackUtil] CAB file not open!"; | 66 | LOG_ERROR() << "CAB file not open!"; |
67 | return false; | 67 | return false; |
68 | } | 68 | } |
69 | 69 | ||
@@ -78,7 +78,7 @@ bool MsPackUtil::extractArchive(const QString& dest, QString file) | |||
78 | struct mscabd_file *f = m_cabinet->files; | 78 | struct mscabd_file *f = m_cabinet->files; |
79 | if(f == NULL) | 79 | if(f == NULL) |
80 | { | 80 | { |
81 | qDebug() << "[MsPackUtil] CAB doesn't contain file" << file; | 81 | LOG_WARNING() << "CAB doesn't contain file" << file; |
82 | return true; | 82 | return true; |
83 | } | 83 | } |
84 | bool found = false; | 84 | bool found = false; |
@@ -99,7 +99,7 @@ bool MsPackUtil::extractArchive(const QString& dest, QString file) | |||
99 | if(!QDir().mkpath(QFileInfo(path).absolutePath())) | 99 | if(!QDir().mkpath(QFileInfo(path).absolutePath())) |
100 | { | 100 | { |
101 | emit logItem(tr("Creating output path failed"), LOGERROR); | 101 | emit logItem(tr("Creating output path failed"), LOGERROR); |
102 | qDebug() << "[MsPackUtil] creating output path failed for:" << path; | 102 | LOG_ERROR() << "creating output path failed for:" << path; |
103 | emit logProgress(1, 1); | 103 | emit logProgress(1, 1); |
104 | return false; | 104 | return false; |
105 | } | 105 | } |
@@ -107,7 +107,8 @@ bool MsPackUtil::extractArchive(const QString& dest, QString file) | |||
107 | if(ret != MSPACK_ERR_OK) | 107 | if(ret != MSPACK_ERR_OK) |
108 | { | 108 | { |
109 | emit logItem(tr("Error during CAB operation"), LOGERROR); | 109 | emit logItem(tr("Error during CAB operation"), LOGERROR); |
110 | qDebug() << "[MsPackUtil] mspack error: " << ret << "(" << errorStringMsPack(ret) << ")"; | 110 | LOG_ERROR() << "mspack error: " << ret |
111 | << "(" << errorStringMsPack(ret) << ")"; | ||
111 | emit logProgress(1, 1); | 112 | emit logProgress(1, 1); |
112 | return false; | 113 | return false; |
113 | } | 114 | } |
@@ -125,7 +126,7 @@ QStringList MsPackUtil::files(void) | |||
125 | QStringList list; | 126 | QStringList list; |
126 | if(!m_cabinet) | 127 | if(!m_cabinet) |
127 | { | 128 | { |
128 | qDebug() << "[MsPackUtil] CAB file not open!"; | 129 | LOG_WARNING() << "CAB file not open!"; |
129 | return list; | 130 | return list; |
130 | } | 131 | } |
131 | struct mscabd_file *file = m_cabinet->files; | 132 | struct mscabd_file *file = m_cabinet->files; |
diff --git a/rbutil/rbutilqt/base/rbsettings.cpp b/rbutil/rbutilqt/base/rbsettings.cpp index a2f801844b..854883c4dd 100644 --- a/rbutil/rbutilqt/base/rbsettings.cpp +++ b/rbutil/rbutilqt/base/rbsettings.cpp | |||
@@ -19,6 +19,7 @@ | |||
19 | #include "rbsettings.h" | 19 | #include "rbsettings.h" |
20 | #include "systeminfo.h" | 20 | #include "systeminfo.h" |
21 | #include <QSettings> | 21 | #include <QSettings> |
22 | #include "Logger.h" | ||
22 | 23 | ||
23 | #if defined(Q_OS_LINUX) | 24 | #if defined(Q_OS_LINUX) |
24 | #include <unistd.h> | 25 | #include <unistd.h> |
@@ -96,13 +97,13 @@ void RbSettings::ensureRbSettingsExists() | |||
96 | { | 97 | { |
97 | userSettings = new QSettings(QCoreApplication::instance()->applicationDirPath() | 98 | userSettings = new QSettings(QCoreApplication::instance()->applicationDirPath() |
98 | + "/RockboxUtility.ini", QSettings::IniFormat, NULL); | 99 | + "/RockboxUtility.ini", QSettings::IniFormat, NULL); |
99 | qDebug() << "[Settings] configuration: portable"; | 100 | LOG_INFO() << "configuration: portable"; |
100 | } | 101 | } |
101 | else | 102 | else |
102 | { | 103 | { |
103 | userSettings = new QSettings(QSettings::IniFormat, | 104 | userSettings = new QSettings(QSettings::IniFormat, |
104 | QSettings::UserScope, "rockbox.org", "RockboxUtility",NULL); | 105 | QSettings::UserScope, "rockbox.org", "RockboxUtility",NULL); |
105 | qDebug() << "[Settings] configuration: system"; | 106 | LOG_INFO() << "configuration: system"; |
106 | } | 107 | } |
107 | } | 108 | } |
108 | } | 109 | } |
@@ -158,7 +159,7 @@ QVariant RbSettings::subValue(QString sub, enum UserSettings setting) | |||
158 | i++; | 159 | i++; |
159 | 160 | ||
160 | QString s = constructSettingPath(UserSettingsList[i].name, sub); | 161 | QString s = constructSettingPath(UserSettingsList[i].name, sub); |
161 | qDebug() << "[Settings] GET U:" << s << userSettings->value(s).toString(); | 162 | LOG_INFO() << "GET U:" << s << userSettings->value(s).toString(); |
162 | return userSettings->value(s, UserSettingsList[i].def); | 163 | return userSettings->value(s, UserSettingsList[i].def); |
163 | } | 164 | } |
164 | 165 | ||
@@ -179,7 +180,7 @@ void RbSettings::setSubValue(QString sub, enum UserSettings setting, QVariant va | |||
179 | 180 | ||
180 | QString s = constructSettingPath(UserSettingsList[i].name, sub); | 181 | QString s = constructSettingPath(UserSettingsList[i].name, sub); |
181 | userSettings->setValue(s, value); | 182 | userSettings->setValue(s, value); |
182 | qDebug() << "[Settings] SET U:" << s << userSettings->value(s).toString(); | 183 | LOG_INFO() << "SET U:" << s << userSettings->value(s).toString(); |
183 | } | 184 | } |
184 | 185 | ||
185 | QString RbSettings::constructSettingPath(QString path, QString substitute) | 186 | QString RbSettings::constructSettingPath(QString path, QString substitute) |
diff --git a/rbutil/rbutilqt/base/rockboxinfo.cpp b/rbutil/rbutilqt/base/rockboxinfo.cpp index e5bce09d2c..f34adbfc2f 100644 --- a/rbutil/rbutilqt/base/rockboxinfo.cpp +++ b/rbutil/rbutilqt/base/rockboxinfo.cpp | |||
@@ -20,10 +20,11 @@ | |||
20 | 20 | ||
21 | #include <QtCore> | 21 | #include <QtCore> |
22 | #include <QDebug> | 22 | #include <QDebug> |
23 | #include "Logger.h" | ||
23 | 24 | ||
24 | RockboxInfo::RockboxInfo(QString mountpoint, QString fname) | 25 | RockboxInfo::RockboxInfo(QString mountpoint, QString fname) |
25 | { | 26 | { |
26 | qDebug() << "[RockboxInfo] Getting version info from rockbox-info.txt"; | 27 | LOG_INFO() << "Getting version info from rockbox-info.txt"; |
27 | QFile file(mountpoint + "/" + fname); | 28 | QFile file(mountpoint + "/" + fname); |
28 | m_success = false; | 29 | m_success = false; |
29 | m_voicefmt = 400; // default value for compatibility | 30 | m_voicefmt = 400; // default value for compatibility |
diff --git a/rbutil/rbutilqt/base/serverinfo.cpp b/rbutil/rbutilqt/base/serverinfo.cpp index 8d91309e66..4773c1ee71 100644 --- a/rbutil/rbutilqt/base/serverinfo.cpp +++ b/rbutil/rbutilqt/base/serverinfo.cpp | |||
@@ -19,6 +19,7 @@ | |||
19 | #include "serverinfo.h" | 19 | #include "serverinfo.h" |
20 | #include "rbsettings.h" | 20 | #include "rbsettings.h" |
21 | #include "systeminfo.h" | 21 | #include "systeminfo.h" |
22 | #include "Logger.h" | ||
22 | 23 | ||
23 | #if defined(Q_OS_LINUX) | 24 | #if defined(Q_OS_LINUX) |
24 | #include <unistd.h> | 25 | #include <unistd.h> |
@@ -181,7 +182,7 @@ QVariant ServerInfo::value(enum ServerInfos info) | |||
181 | 182 | ||
182 | QString s = ServerInfoList[i].name; | 183 | QString s = ServerInfoList[i].name; |
183 | s.replace(":platform:", RbSettings::value(RbSettings::CurrentPlatform).toString()); | 184 | s.replace(":platform:", RbSettings::value(RbSettings::CurrentPlatform).toString()); |
184 | qDebug() << "[ServerInfo] GET:" << s << serverInfos.value(s, ServerInfoList[i].def).toString(); | 185 | LOG_INFO() << "GET:" << s << serverInfos.value(s, ServerInfoList[i].def).toString(); |
185 | return serverInfos.value(s, ServerInfoList[i].def); | 186 | return serverInfos.value(s, ServerInfoList[i].def); |
186 | } | 187 | } |
187 | 188 | ||
@@ -201,7 +202,7 @@ void ServerInfo::setPlatformValue(QString platform, enum ServerInfos info, QVari | |||
201 | QString s = ServerInfoList[i].name; | 202 | QString s = ServerInfoList[i].name; |
202 | s.replace(":platform:", platform); | 203 | s.replace(":platform:", platform); |
203 | serverInfos.insert(s, value); | 204 | serverInfos.insert(s, value); |
204 | qDebug() << "[ServerInfo] SET:" << s << serverInfos.value(s).toString(); | 205 | LOG_INFO() << "SET:" << s << serverInfos.value(s).toString(); |
205 | } | 206 | } |
206 | 207 | ||
207 | QVariant ServerInfo::platformValue(QString platform, enum ServerInfos info) | 208 | QVariant ServerInfo::platformValue(QString platform, enum ServerInfos info) |
@@ -215,7 +216,7 @@ QVariant ServerInfo::platformValue(QString platform, enum ServerInfos info) | |||
215 | s.replace(":platform:", platform); | 216 | s.replace(":platform:", platform); |
216 | QString d = ServerInfoList[i].def; | 217 | QString d = ServerInfoList[i].def; |
217 | d.replace(":platform:", platform); | 218 | d.replace(":platform:", platform); |
218 | qDebug() << "[ServerInfo] GET:" << s << serverInfos.value(s, d).toString(); | 219 | LOG_INFO() << "GET:" << s << serverInfos.value(s, d).toString(); |
219 | return serverInfos.value(s, d); | 220 | return serverInfos.value(s, d); |
220 | } | 221 | } |
221 | 222 | ||
diff --git a/rbutil/rbutilqt/base/system.cpp b/rbutil/rbutilqt/base/system.cpp index fd3b04e338..117e5dc9b4 100644 --- a/rbutil/rbutilqt/base/system.cpp +++ b/rbutil/rbutilqt/base/system.cpp | |||
@@ -69,6 +69,7 @@ | |||
69 | 69 | ||
70 | #include "utils.h" | 70 | #include "utils.h" |
71 | #include "rbsettings.h" | 71 | #include "rbsettings.h" |
72 | #include "Logger.h" | ||
72 | 73 | ||
73 | /** @brief detect permission of user (only Windows at moment). | 74 | /** @brief detect permission of user (only Windows at moment). |
74 | * @return enum userlevel. | 75 | * @return enum userlevel. |
@@ -242,17 +243,17 @@ QMap<uint32_t, QString> System::listUsbDevices(void) | |||
242 | { | 243 | { |
243 | QMap<uint32_t, QString> usbids; | 244 | QMap<uint32_t, QString> usbids; |
244 | // usb pid detection | 245 | // usb pid detection |
245 | qDebug() << "[System] Searching for USB devices"; | 246 | LOG_INFO() << "Searching for USB devices"; |
246 | #if defined(Q_OS_LINUX) | 247 | #if defined(Q_OS_LINUX) |
247 | #if defined(LIBUSB1) | 248 | #if defined(LIBUSB1) |
248 | libusb_device **devs; | 249 | libusb_device **devs; |
249 | if(libusb_init(NULL) != 0) { | 250 | if(libusb_init(NULL) != 0) { |
250 | qDebug() << "[System] Initializing libusb-1 failed."; | 251 | LOG_ERROR() << "Initializing libusb-1 failed."; |
251 | return usbids; | 252 | return usbids; |
252 | } | 253 | } |
253 | 254 | ||
254 | if(libusb_get_device_list(NULL, &devs) < 1) { | 255 | if(libusb_get_device_list(NULL, &devs) < 1) { |
255 | qDebug() << "[System] Error getting device list."; | 256 | LOG_ERROR() << "Error getting device list."; |
256 | return usbids; | 257 | return usbids; |
257 | } | 258 | } |
258 | libusb_device *dev; | 259 | libusb_device *dev; |
@@ -277,7 +278,7 @@ QMap<uint32_t, QString> System::listUsbDevices(void) | |||
277 | name = tr("(no description available)"); | 278 | name = tr("(no description available)"); |
278 | if(id) { | 279 | if(id) { |
279 | usbids.insertMulti(id, name); | 280 | usbids.insertMulti(id, name); |
280 | qDebug("[System] USB: 0x%08x, %s", id, name.toLocal8Bit().data()); | 281 | LOG_INFO("USB: 0x%08x, %s", id, name.toLocal8Bit().data()); |
281 | } | 282 | } |
282 | } | 283 | } |
283 | } | 284 | } |
@@ -323,7 +324,7 @@ QMap<uint32_t, QString> System::listUsbDevices(void) | |||
323 | 324 | ||
324 | if(id) { | 325 | if(id) { |
325 | usbids.insertMulti(id, name); | 326 | usbids.insertMulti(id, name); |
326 | qDebug() << "[System] USB:" << QString("0x%1").arg(id, 8, 16) << name; | 327 | LOG_INFO() << "USB:" << QString("0x%1").arg(id, 8, 16) << name; |
327 | } | 328 | } |
328 | u = u->next; | 329 | u = u->next; |
329 | } | 330 | } |
@@ -341,7 +342,7 @@ QMap<uint32_t, QString> System::listUsbDevices(void) | |||
341 | result = IOServiceGetMatchingServices(kIOMasterPortDefault, usb_matching_dictionary, | 342 | result = IOServiceGetMatchingServices(kIOMasterPortDefault, usb_matching_dictionary, |
342 | &usb_iterator); | 343 | &usb_iterator); |
343 | if(result) { | 344 | if(result) { |
344 | qDebug() << "[System] USB: IOKit: Could not get matching services."; | 345 | LOG_ERROR() << "USB: IOKit: Could not get matching services."; |
345 | return usbids; | 346 | return usbids; |
346 | } | 347 | } |
347 | 348 | ||
@@ -404,7 +405,7 @@ QMap<uint32_t, QString> System::listUsbDevices(void) | |||
404 | 405 | ||
405 | if(id) { | 406 | if(id) { |
406 | usbids.insertMulti(id, name); | 407 | usbids.insertMulti(id, name); |
407 | qDebug() << "[System] USB:" << QString("0x%1").arg(id, 8, 16) << name; | 408 | LOG_INFO() << "USB:" << QString("0x%1").arg(id, 8, 16) << name; |
408 | } | 409 | } |
409 | 410 | ||
410 | } | 411 | } |
@@ -468,7 +469,7 @@ QMap<uint32_t, QString> System::listUsbDevices(void) | |||
468 | uint32_t id; | 469 | uint32_t id; |
469 | id = vid << 16 | pid; | 470 | id = vid << 16 | pid; |
470 | usbids.insert(id, description); | 471 | usbids.insert(id, description); |
471 | qDebug("[System] USB VID: %04x, PID: %04x", vid, pid); | 472 | LOG_INFO("USB VID: %04x, PID: %04x", vid, pid); |
472 | } | 473 | } |
473 | if(buffer) free(buffer); | 474 | if(buffer) free(buffer); |
474 | } | 475 | } |
@@ -507,7 +508,7 @@ QUrl System::systemProxy(void) | |||
507 | 508 | ||
508 | RegCloseKey(hk); | 509 | RegCloseKey(hk); |
509 | 510 | ||
510 | //qDebug() << QString::fromWCharArray(proxyval) << QString("%1").arg(enable); | 511 | //LOG_INFO() << QString::fromWCharArray(proxyval) << QString("%1").arg(enable); |
511 | if(enable != 0) | 512 | if(enable != 0) |
512 | return QUrl("http://" + QString::fromWCharArray(proxyval)); | 513 | return QUrl("http://" + QString::fromWCharArray(proxyval)); |
513 | else | 514 | else |
@@ -537,7 +538,7 @@ QUrl System::systemProxy(void) | |||
537 | bufsize = CFStringGetLength(stringref) * 2 + 1; | 538 | bufsize = CFStringGetLength(stringref) * 2 + 1; |
538 | buf = (char*)malloc(sizeof(char) * bufsize); | 539 | buf = (char*)malloc(sizeof(char) * bufsize); |
539 | if(buf == NULL) { | 540 | if(buf == NULL) { |
540 | qDebug() << "[System] can't allocate memory for proxy string!"; | 541 | LOG_ERROR() << "can't allocate memory for proxy string!"; |
541 | CFRelease(dictref); | 542 | CFRelease(dictref); |
542 | return QUrl(""); | 543 | return QUrl(""); |
543 | } | 544 | } |
diff --git a/rbutil/rbutilqt/base/systeminfo.cpp b/rbutil/rbutilqt/base/systeminfo.cpp index 971a1196ac..d75b90c22d 100644 --- a/rbutil/rbutilqt/base/systeminfo.cpp +++ b/rbutil/rbutilqt/base/systeminfo.cpp | |||
@@ -16,10 +16,11 @@ | |||
16 | * | 16 | * |
17 | ****************************************************************************/ | 17 | ****************************************************************************/ |
18 | 18 | ||
19 | #include "systeminfo.h" | 19 | #include "systeminfo.h" |
20 | #include "rbsettings.h" | 20 | #include "rbsettings.h" |
21 | 21 | ||
22 | #include <QSettings> | 22 | #include <QSettings> |
23 | #include "Logger.h" | ||
23 | 24 | ||
24 | #if defined(Q_OS_LINUX) | 25 | #if defined(Q_OS_LINUX) |
25 | #include <unistd.h> | 26 | #include <unistd.h> |
@@ -89,7 +90,7 @@ QVariant SystemInfo::value(enum SystemInfos info) | |||
89 | s.replace(":platform:", platform); | 90 | s.replace(":platform:", platform); |
90 | QString d = SystemInfosList[i].def; | 91 | QString d = SystemInfosList[i].def; |
91 | d.replace(":platform:", platform); | 92 | d.replace(":platform:", platform); |
92 | qDebug() << "[SystemInfo] GET:" << s << systemInfos->value(s, d).toString(); | 93 | LOG_INFO() << "GET:" << s << systemInfos->value(s, d).toString(); |
93 | return systemInfos->value(s, d); | 94 | return systemInfos->value(s, d); |
94 | } | 95 | } |
95 | 96 | ||
@@ -106,7 +107,7 @@ QVariant SystemInfo::platformValue(QString platform, enum SystemInfos info) | |||
106 | s.replace(":platform:", platform); | 107 | s.replace(":platform:", platform); |
107 | QString d = SystemInfosList[i].def; | 108 | QString d = SystemInfosList[i].def; |
108 | d.replace(":platform:", platform); | 109 | d.replace(":platform:", platform); |
109 | qDebug() << "[SystemInfo] GET P:" << s << systemInfos->value(s, d).toString(); | 110 | LOG_INFO() << "GET P:" << s << systemInfos->value(s, d).toString(); |
110 | return systemInfos->value(s, d); | 111 | return systemInfos->value(s, d); |
111 | } | 112 | } |
112 | 113 | ||
diff --git a/rbutil/rbutilqt/base/talkfile.cpp b/rbutil/rbutilqt/base/talkfile.cpp index dc4dceef08..1e9a968576 100644 --- a/rbutil/rbutilqt/base/talkfile.cpp +++ b/rbutil/rbutilqt/base/talkfile.cpp | |||
@@ -18,6 +18,7 @@ | |||
18 | 18 | ||
19 | #include "talkfile.h" | 19 | #include "talkfile.h" |
20 | #include "rbsettings.h" | 20 | #include "rbsettings.h" |
21 | #include "Logger.h" | ||
21 | 22 | ||
22 | TalkFileCreator::TalkFileCreator(QObject* parent): QObject(parent) | 23 | TalkFileCreator::TalkFileCreator(QObject* parent): QObject(parent) |
23 | { | 24 | { |
@@ -109,7 +110,7 @@ void TalkFileCreator::doAbort() | |||
109 | //! \param startDir The directory from which to start scanning | 110 | //! \param startDir The directory from which to start scanning |
110 | bool TalkFileCreator::createTalkList(QDir startDir) | 111 | bool TalkFileCreator::createTalkList(QDir startDir) |
111 | { | 112 | { |
112 | qDebug() << "[TalkGenerator] generating list of files" << startDir; | 113 | LOG_INFO() << "generating list of files" << startDir; |
113 | m_talkList.clear(); | 114 | m_talkList.clear(); |
114 | 115 | ||
115 | // create Iterator | 116 | // create Iterator |
@@ -161,9 +162,9 @@ bool TalkFileCreator::createTalkList(QDir startDir) | |||
161 | entry.target = dir.path() + "/_dirname.talk"; | 162 | entry.target = dir.path() + "/_dirname.talk"; |
162 | entry.voiced = false; | 163 | entry.voiced = false; |
163 | entry.encoded = false; | 164 | entry.encoded = false; |
164 | qDebug() << "[TalkFileCreator] toSpeak:" << entry.toSpeak | 165 | LOG_INFO() << "toSpeak:" << entry.toSpeak |
165 | << "target:" << entry.target | 166 | << "target:" << entry.target |
166 | << "intermediates:" << entry.wavfilename << entry.talkfilename; | 167 | << "intermediates:" << entry.wavfilename << entry.talkfilename; |
167 | m_talkList.append(entry); | 168 | m_talkList.append(entry); |
168 | } | 169 | } |
169 | } | 170 | } |
@@ -205,16 +206,16 @@ bool TalkFileCreator::createTalkList(QDir startDir) | |||
205 | entry.target = fileInf.path() + "/" + fileInf.fileName() + ".talk"; | 206 | entry.target = fileInf.path() + "/" + fileInf.fileName() + ".talk"; |
206 | entry.voiced = false; | 207 | entry.voiced = false; |
207 | entry.encoded = false; | 208 | entry.encoded = false; |
208 | qDebug() << "[TalkFileCreator] toSpeak:" << entry.toSpeak | 209 | LOG_INFO() << "toSpeak:" << entry.toSpeak |
209 | << "target:" << entry.target | 210 | << "target:" << entry.target |
210 | << "intermediates:" << | 211 | << "intermediates:" |
211 | entry.wavfilename << entry.talkfilename; | 212 | << entry.wavfilename << entry.talkfilename; |
212 | m_talkList.append(entry); | 213 | m_talkList.append(entry); |
213 | } | 214 | } |
214 | } | 215 | } |
215 | QCoreApplication::processEvents(); | 216 | QCoreApplication::processEvents(); |
216 | } | 217 | } |
217 | qDebug() << "[TalkFileCreator] list created, entries:" << m_talkList.size(); | 218 | LOG_INFO() << "list created, entries:" << m_talkList.size(); |
218 | return true; | 219 | return true; |
219 | } | 220 | } |
220 | 221 | ||
@@ -251,8 +252,8 @@ bool TalkFileCreator::copyTalkFiles(QString* errString) | |||
251 | QFile::remove(m_talkList[i].target); | 252 | QFile::remove(m_talkList[i].target); |
252 | 253 | ||
253 | // copying | 254 | // copying |
254 | qDebug() << "[TalkFileCreator] copying" << m_talkList[i].talkfilename | 255 | LOG_INFO() << "copying" << m_talkList[i].talkfilename |
255 | << "to" << m_talkList[i].target; | 256 | << "to" << m_talkList[i].target; |
256 | if(!QFile::copy(m_talkList[i].talkfilename,m_talkList[i].target)) | 257 | if(!QFile::copy(m_talkList[i].talkfilename,m_talkList[i].target)) |
257 | { | 258 | { |
258 | *errString = tr("Copying of %1 to %2 failed").arg(m_talkList[i].talkfilename).arg(m_talkList[i].target); | 259 | *errString = tr("Copying of %1 to %2 failed").arg(m_talkList[i].talkfilename).arg(m_talkList[i].target); |
diff --git a/rbutil/rbutilqt/base/talkgenerator.cpp b/rbutil/rbutilqt/base/talkgenerator.cpp index a2ab578ade..32686c78c2 100644 --- a/rbutil/rbutilqt/base/talkgenerator.cpp +++ b/rbutil/rbutilqt/base/talkgenerator.cpp | |||
@@ -20,6 +20,7 @@ | |||
20 | #include "rbsettings.h" | 20 | #include "rbsettings.h" |
21 | #include "systeminfo.h" | 21 | #include "systeminfo.h" |
22 | #include "wavtrim.h" | 22 | #include "wavtrim.h" |
23 | #include "Logger.h" | ||
23 | 24 | ||
24 | TalkGenerator::TalkGenerator(QObject* parent): QObject(parent) | 25 | TalkGenerator::TalkGenerator(QObject* parent): QObject(parent) |
25 | { | 26 | { |
@@ -39,7 +40,7 @@ TalkGenerator::Status TalkGenerator::process(QList<TalkEntry>* list,int wavtrimt | |||
39 | m_tts = TTSBase::getTTS(this, RbSettings::value(RbSettings::Tts).toString()); | 40 | m_tts = TTSBase::getTTS(this, RbSettings::value(RbSettings::Tts).toString()); |
40 | if(!m_tts) | 41 | if(!m_tts) |
41 | { | 42 | { |
42 | qDebug() << "[TalkGenerator] getting the TTS object failed!"; | 43 | LOG_ERROR() << "getting the TTS object failed!"; |
43 | emit logItem(tr("Init of TTS engine failed"), LOGERROR); | 44 | emit logItem(tr("Init of TTS engine failed"), LOGERROR); |
44 | emit done(true); | 45 | emit done(true); |
45 | return eERROR; | 46 | return eERROR; |
@@ -131,7 +132,7 @@ TalkGenerator::Status TalkGenerator::voiceList(QList<TalkEntry>* list,int wavtri | |||
131 | duplicates.append(list->at(i).wavfilename); | 132 | duplicates.append(list->at(i).wavfilename); |
132 | else | 133 | else |
133 | { | 134 | { |
134 | qDebug() << "[TalkGenerator] duplicate skipped"; | 135 | LOG_INFO() << "duplicate skipped"; |
135 | (*list)[i].voiced = true; | 136 | (*list)[i].voiced = true; |
136 | emit logProgress(++m_progress,progressMax); | 137 | emit logProgress(++m_progress,progressMax); |
137 | continue; | 138 | continue; |
@@ -152,7 +153,7 @@ TalkGenerator::Status TalkGenerator::voiceList(QList<TalkEntry>* list,int wavtri | |||
152 | 153 | ||
153 | // voice entry | 154 | // voice entry |
154 | QString error; | 155 | QString error; |
155 | qDebug() << "[TalkGenerator] voicing: " << list->at(i).toSpeak | 156 | LOG_INFO() << "voicing: " << list->at(i).toSpeak |
156 | << "to" << list->at(i).wavfilename; | 157 | << "to" << list->at(i).wavfilename; |
157 | TTSStatus status = m_tts->voice(list->at(i).toSpeak,list->at(i).wavfilename, &error); | 158 | TTSStatus status = m_tts->voice(list->at(i).toSpeak,list->at(i).wavfilename, &error); |
158 | if(status == Warning) | 159 | if(status == Warning) |
@@ -177,8 +178,8 @@ TalkGenerator::Status TalkGenerator::voiceList(QList<TalkEntry>* list,int wavtri | |||
177 | if(wavtrim(list->at(i).wavfilename.toLocal8Bit().data(), | 178 | if(wavtrim(list->at(i).wavfilename.toLocal8Bit().data(), |
178 | wavtrimth, buffer, 255)) | 179 | wavtrimth, buffer, 255)) |
179 | { | 180 | { |
180 | qDebug() << "[TalkGenerator] wavtrim returned error on" | 181 | LOG_ERROR() << "wavtrim returned error on" |
181 | << list->at(i).wavfilename; | 182 | << list->at(i).wavfilename; |
182 | return eERROR; | 183 | return eERROR; |
183 | } | 184 | } |
184 | } | 185 | } |
@@ -214,8 +215,8 @@ TalkGenerator::Status TalkGenerator::encodeList(QList<TalkEntry>* list) | |||
214 | //skip non-voiced entrys | 215 | //skip non-voiced entrys |
215 | if(list->at(i).voiced == false) | 216 | if(list->at(i).voiced == false) |
216 | { | 217 | { |
217 | qDebug() << "[TalkGenerator] non voiced entry detected:" | 218 | LOG_WARNING() << "non voiced entry detected:" |
218 | << list->at(i).toSpeak; | 219 | << list->at(i).toSpeak; |
219 | emit logProgress(++m_progress,progressMax); | 220 | emit logProgress(++m_progress,progressMax); |
220 | continue; | 221 | continue; |
221 | } | 222 | } |
@@ -224,15 +225,15 @@ TalkGenerator::Status TalkGenerator::encodeList(QList<TalkEntry>* list) | |||
224 | duplicates.append(list->at(i).talkfilename); | 225 | duplicates.append(list->at(i).talkfilename); |
225 | else | 226 | else |
226 | { | 227 | { |
227 | qDebug() << "[TalkGenerator] duplicate skipped"; | 228 | LOG_INFO() << "duplicate skipped"; |
228 | (*list)[i].encoded = true; | 229 | (*list)[i].encoded = true; |
229 | emit logProgress(++m_progress,progressMax); | 230 | emit logProgress(++m_progress,progressMax); |
230 | continue; | 231 | continue; |
231 | } | 232 | } |
232 | 233 | ||
233 | //encode entry | 234 | //encode entry |
234 | qDebug() << "[TalkGenerator] encoding " << list->at(i).wavfilename | 235 | LOG_INFO() << "encoding " << list->at(i).wavfilename |
235 | << "to" << list->at(i).talkfilename; | 236 | << "to" << list->at(i).talkfilename; |
236 | if(!m_enc->encode(list->at(i).wavfilename,list->at(i).talkfilename)) | 237 | if(!m_enc->encode(list->at(i).wavfilename,list->at(i).talkfilename)) |
237 | { | 238 | { |
238 | emit logItem(tr("Encoding of %1 failed").arg( | 239 | emit logItem(tr("Encoding of %1 failed").arg( |
@@ -268,7 +269,7 @@ QString TalkGenerator::correctString(QString s) | |||
268 | } | 269 | } |
269 | 270 | ||
270 | if(corrected != s) | 271 | if(corrected != s) |
271 | qDebug() << "[VoiceFileCreator] corrected string" << s << "to" << corrected; | 272 | LOG_INFO() << "corrected string" << s << "to" << corrected; |
272 | 273 | ||
273 | return corrected; | 274 | return corrected; |
274 | m_abort = true; | 275 | m_abort = true; |
@@ -287,7 +288,7 @@ void TalkGenerator::setLang(QString name) | |||
287 | TTSBase* tts = TTSBase::getTTS(this,RbSettings::value(RbSettings::Tts).toString()); | 288 | TTSBase* tts = TTSBase::getTTS(this,RbSettings::value(RbSettings::Tts).toString()); |
288 | if(!tts) | 289 | if(!tts) |
289 | { | 290 | { |
290 | qDebug() << "[TalkGenerator] getting the TTS object failed!"; | 291 | LOG_ERROR() << "getting the TTS object failed!"; |
291 | return; | 292 | return; |
292 | } | 293 | } |
293 | QString vendor = tts->voiceVendor(); | 294 | QString vendor = tts->voiceVendor(); |
@@ -295,8 +296,8 @@ void TalkGenerator::setLang(QString name) | |||
295 | 296 | ||
296 | if(m_lang.isEmpty()) | 297 | if(m_lang.isEmpty()) |
297 | m_lang = "english"; | 298 | m_lang = "english"; |
298 | qDebug() << "[TalkGenerator] building string corrections list for" | 299 | LOG_INFO() << "building string corrections list for" |
299 | << m_lang << engine << vendor; | 300 | << m_lang << engine << vendor; |
300 | QTextStream stream(&correctionsFile); | 301 | QTextStream stream(&correctionsFile); |
301 | while(!stream.atEnd()) { | 302 | while(!stream.atEnd()) { |
302 | QString line = stream.readLine(); | 303 | QString line = stream.readLine(); |
diff --git a/rbutil/rbutilqt/base/ttscarbon.cpp b/rbutil/rbutilqt/base/ttscarbon.cpp index ff7709dc63..a01d402cd4 100644 --- a/rbutil/rbutilqt/base/ttscarbon.cpp +++ b/rbutil/rbutilqt/base/ttscarbon.cpp | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <unistd.h> | 28 | #include <unistd.h> |
29 | #include <sys/stat.h> | 29 | #include <sys/stat.h> |
30 | #include <inttypes.h> | 30 | #include <inttypes.h> |
31 | #include "Logger.h" | ||
31 | 32 | ||
32 | TTSCarbon::TTSCarbon(QObject* parent) : TTSBase(parent) | 33 | TTSCarbon::TTSCarbon(QObject* parent) : TTSBase(parent) |
33 | { | 34 | { |
@@ -74,7 +75,7 @@ bool TTSCarbon::start(QString *errStr) | |||
74 | if(voiceIndex == numVoices) { | 75 | if(voiceIndex == numVoices) { |
75 | // voice not found. Add user notification here and proceed with | 76 | // voice not found. Add user notification here and proceed with |
76 | // system default voice. | 77 | // system default voice. |
77 | qDebug() << "[TTSCarbon] Selected voice not found, using system default!"; | 78 | LOG_WARNING() << "Selected voice not found, using system default!"; |
78 | GetVoiceDescription(&vspec, &vdesc, sizeof(vdesc)); | 79 | GetVoiceDescription(&vspec, &vdesc, sizeof(vdesc)); |
79 | if(vdesc.script != -1) | 80 | if(vdesc.script != -1) |
80 | m_voiceScript = (CFStringBuiltInEncodings)vdesc.script; | 81 | m_voiceScript = (CFStringBuiltInEncodings)vdesc.script; |
diff --git a/rbutil/rbutilqt/base/ttsexes.cpp b/rbutil/rbutilqt/base/ttsexes.cpp index 348db103bc..a8c10bfb19 100644 --- a/rbutil/rbutilqt/base/ttsexes.cpp +++ b/rbutil/rbutilqt/base/ttsexes.cpp | |||
@@ -20,6 +20,7 @@ | |||
20 | #include "ttsexes.h" | 20 | #include "ttsexes.h" |
21 | #include "utils.h" | 21 | #include "utils.h" |
22 | #include "rbsettings.h" | 22 | #include "rbsettings.h" |
23 | #include "Logger.h" | ||
23 | 24 | ||
24 | TTSExes::TTSExes(QObject* parent) : TTSBase(parent) | 25 | TTSExes::TTSExes(QObject* parent) : TTSBase(parent) |
25 | { | 26 | { |
@@ -85,15 +86,15 @@ TTSStatus TTSExes::voice(QString text, QString wavfile, QString *errStr) | |||
85 | QString execstring; | 86 | QString execstring; |
86 | if(wavfile.isEmpty() && m_capabilities & TTSBase::CanSpeak) { | 87 | if(wavfile.isEmpty() && m_capabilities & TTSBase::CanSpeak) { |
87 | if(m_TTSSpeakTemplate.isEmpty()) { | 88 | if(m_TTSSpeakTemplate.isEmpty()) { |
88 | qDebug() << "[TTSExes] internal error: TTS announces CanSpeak " | 89 | LOG_ERROR() << "internal error: TTS announces CanSpeak " |
89 | "but template empty!"; | 90 | "but template empty!"; |
90 | return FatalError; | 91 | return FatalError; |
91 | } | 92 | } |
92 | execstring = m_TTSSpeakTemplate; | 93 | execstring = m_TTSSpeakTemplate; |
93 | } | 94 | } |
94 | else if(wavfile.isEmpty()) { | 95 | else if(wavfile.isEmpty()) { |
95 | qDebug() << "[TTSExes] no output file passed to voice() " | 96 | LOG_ERROR() << "no output file passed to voice() " |
96 | "but TTS can't speak directly."; | 97 | "but TTS can't speak directly."; |
97 | return FatalError; | 98 | return FatalError; |
98 | } | 99 | } |
99 | else { | 100 | else { |
@@ -108,7 +109,7 @@ TTSStatus TTSExes::voice(QString text, QString wavfile, QString *errStr) | |||
108 | QProcess::execute(execstring); | 109 | QProcess::execute(execstring); |
109 | 110 | ||
110 | if(!wavfile.isEmpty() && !QFileInfo(wavfile).isFile()) { | 111 | if(!wavfile.isEmpty() && !QFileInfo(wavfile).isFile()) { |
111 | qDebug() << "[TTSExes] output file does not exist:" << wavfile; | 112 | LOG_ERROR() << "output file does not exist:" << wavfile; |
112 | return FatalError; | 113 | return FatalError; |
113 | } | 114 | } |
114 | return NoError; | 115 | return NoError; |
diff --git a/rbutil/rbutilqt/base/ttsfestival.cpp b/rbutil/rbutilqt/base/ttsfestival.cpp index cbf24a3f03..41358ba488 100644 --- a/rbutil/rbutilqt/base/ttsfestival.cpp +++ b/rbutil/rbutilqt/base/ttsfestival.cpp | |||
@@ -22,10 +22,11 @@ | |||
22 | #include "ttsfestival.h" | 22 | #include "ttsfestival.h" |
23 | #include "utils.h" | 23 | #include "utils.h" |
24 | #include "rbsettings.h" | 24 | #include "rbsettings.h" |
25 | #include "Logger.h" | ||
25 | 26 | ||
26 | TTSFestival::~TTSFestival() | 27 | TTSFestival::~TTSFestival() |
27 | { | 28 | { |
28 | qDebug() << "[Festival] Destroying instance"; | 29 | LOG_INFO() << "Destroying instance"; |
29 | stop(); | 30 | stop(); |
30 | } | 31 | } |
31 | 32 | ||
@@ -87,7 +88,7 @@ void TTSFestival::updateVoiceDescription() | |||
87 | currentPath = getSetting(eSERVERPATH)->current().toString(); | 88 | currentPath = getSetting(eSERVERPATH)->current().toString(); |
88 | QString info = getVoiceInfo(getSetting(eVOICE)->current().toString()); | 89 | QString info = getVoiceInfo(getSetting(eVOICE)->current().toString()); |
89 | currentPath = ""; | 90 | currentPath = ""; |
90 | 91 | ||
91 | getSetting(eVOICEDESC)->setCurrent(info); | 92 | getSetting(eVOICEDESC)->setCurrent(info); |
92 | } | 93 | } |
93 | 94 | ||
@@ -101,7 +102,7 @@ void TTSFestival::updateVoiceList() | |||
101 | currentPath = getSetting(eSERVERPATH)->current().toString(); | 102 | currentPath = getSetting(eSERVERPATH)->current().toString(); |
102 | QStringList voiceList = getVoiceList(); | 103 | QStringList voiceList = getVoiceList(); |
103 | currentPath = ""; | 104 | currentPath = ""; |
104 | 105 | ||
105 | getSetting(eVOICE)->setList(voiceList); | 106 | getSetting(eVOICE)->setList(voiceList); |
106 | if(voiceList.size() > 0) getSetting(eVOICE)->setCurrent(voiceList.at(0)); | 107 | if(voiceList.size() > 0) getSetting(eVOICE)->setCurrent(voiceList.at(0)); |
107 | else getSetting(eVOICE)->setCurrent(""); | 108 | else getSetting(eVOICE)->setCurrent(""); |
@@ -130,9 +131,10 @@ void TTSFestival::startServer() | |||
130 | QCoreApplication::processEvents(QEventLoop::AllEvents, 50); | 131 | QCoreApplication::processEvents(QEventLoop::AllEvents, 50); |
131 | 132 | ||
132 | if(serverProcess.state() == QProcess::Running) | 133 | if(serverProcess.state() == QProcess::Running) |
133 | qDebug() << "[Festival] Server is up and running"; | 134 | LOG_INFO() << "Server is up and running"; |
134 | else | 135 | else |
135 | qDebug() << "[Festival] Server failed to start, state: " << serverProcess.state(); | 136 | LOG_ERROR() << "Server failed to start, state:" |
137 | << serverProcess.state(); | ||
136 | } | 138 | } |
137 | } | 139 | } |
138 | 140 | ||
@@ -147,8 +149,9 @@ bool TTSFestival::ensureServerRunning() | |||
147 | 149 | ||
148 | bool TTSFestival::start(QString* errStr) | 150 | bool TTSFestival::start(QString* errStr) |
149 | { | 151 | { |
150 | qDebug() << "[Festival] Starting server with voice " << RbSettings::subValue("festival", RbSettings::TtsVoice).toString(); | 152 | LOG_INFO() << "Starting server with voice" |
151 | 153 | << RbSettings::subValue("festival", RbSettings::TtsVoice).toString(); | |
154 | |||
152 | bool running = ensureServerRunning(); | 155 | bool running = ensureServerRunning(); |
153 | if (!RbSettings::subValue("festival",RbSettings::TtsVoice).toString().isEmpty()) | 156 | if (!RbSettings::subValue("festival",RbSettings::TtsVoice).toString().isEmpty()) |
154 | { | 157 | { |
@@ -156,17 +159,17 @@ bool TTSFestival::start(QString* errStr) | |||
156 | QString voiceSelect = QString("(voice.select '%1)\n") | 159 | QString voiceSelect = QString("(voice.select '%1)\n") |
157 | .arg(RbSettings::subValue("festival", RbSettings::TtsVoice).toString()); | 160 | .arg(RbSettings::subValue("festival", RbSettings::TtsVoice).toString()); |
158 | queryServer(voiceSelect, 3000); | 161 | queryServer(voiceSelect, 3000); |
159 | 162 | ||
160 | if(prologFile.open()) | 163 | if(prologFile.open()) |
161 | { | 164 | { |
162 | prologFile.write(voiceSelect.toLatin1()); | 165 | prologFile.write(voiceSelect.toLatin1()); |
163 | prologFile.close(); | 166 | prologFile.close(); |
164 | prologPath = QFileInfo(prologFile).absoluteFilePath(); | 167 | prologPath = QFileInfo(prologFile).absoluteFilePath(); |
165 | qDebug() << "[Festival] Prolog created at " << prologPath; | 168 | LOG_INFO() << "Prolog created at" << prologPath; |
166 | } | 169 | } |
167 | 170 | ||
168 | } | 171 | } |
169 | 172 | ||
170 | if (!running) | 173 | if (!running) |
171 | (*errStr) = "Festival could not be started"; | 174 | (*errStr) = "Festival could not be started"; |
172 | return running; | 175 | return running; |
@@ -182,13 +185,13 @@ bool TTSFestival::stop() | |||
182 | 185 | ||
183 | TTSStatus TTSFestival::voice(QString text, QString wavfile, QString* errStr) | 186 | TTSStatus TTSFestival::voice(QString text, QString wavfile, QString* errStr) |
184 | { | 187 | { |
185 | qDebug() << "[Festival] Voicing " << text << "->" << wavfile; | 188 | LOG_INFO() << "Voicing" << text << "->" << wavfile; |
186 | 189 | ||
187 | QString path = RbSettings::subValue("festival-client", | 190 | QString path = RbSettings::subValue("festival-client", |
188 | RbSettings::TtsPath).toString(); | 191 | RbSettings::TtsPath).toString(); |
189 | QString cmd = QString("%1 --server localhost --otype riff --ttw --withlisp" | 192 | QString cmd = QString("%1 --server localhost --otype riff --ttw --withlisp" |
190 | " --output \"%2\" --prolog \"%3\" - ").arg(path).arg(wavfile).arg(prologPath); | 193 | " --output \"%2\" --prolog \"%3\" - ").arg(path).arg(wavfile).arg(prologPath); |
191 | qDebug() << "[Festival] Client cmd: " << cmd; | 194 | LOG_INFO() << "Client cmd:" << cmd; |
192 | 195 | ||
193 | QProcess clientProcess; | 196 | QProcess clientProcess; |
194 | clientProcess.start(cmd); | 197 | clientProcess.start(cmd); |
@@ -200,7 +203,7 @@ TTSStatus TTSFestival::voice(QString text, QString wavfile, QString* errStr) | |||
200 | response = response.trimmed(); | 203 | response = response.trimmed(); |
201 | if(!response.contains("Utterance")) | 204 | if(!response.contains("Utterance")) |
202 | { | 205 | { |
203 | qDebug() << "[Festival] Could not voice string: " << response; | 206 | LOG_WARNING() << "Could not voice string: " << response; |
204 | *errStr = tr("engine could not voice string"); | 207 | *errStr = tr("engine could not voice string"); |
205 | return Warning; | 208 | return Warning; |
206 | /* do not stop the voicing process because of a single string | 209 | /* do not stop the voicing process because of a single string |
@@ -231,10 +234,10 @@ bool TTSFestival::configOk() | |||
231 | ret = ret && (voices.indexOf(RbSettings::subValue("festival", | 234 | ret = ret && (voices.indexOf(RbSettings::subValue("festival", |
232 | RbSettings::TtsVoice).toString()) != -1); | 235 | RbSettings::TtsVoice).toString()) != -1); |
233 | } | 236 | } |
234 | else /* If we're currently configuring the server, we need to know that | 237 | else /* If we're currently configuring the server, we need to know that |
235 | the entered path is valid */ | 238 | the entered path is valid */ |
236 | ret = QFileInfo(currentPath).isExecutable(); | 239 | ret = QFileInfo(currentPath).isExecutable(); |
237 | 240 | ||
238 | return ret; | 241 | return ret; |
239 | } | 242 | } |
240 | 243 | ||
@@ -245,7 +248,7 @@ QStringList TTSFestival::getVoiceList() | |||
245 | 248 | ||
246 | if(voices.size() > 0) | 249 | if(voices.size() > 0) |
247 | { | 250 | { |
248 | qDebug() << "[Festival] Using voice cache"; | 251 | LOG_INFO() << "Using voice cache"; |
249 | return voices; | 252 | return voices; |
250 | } | 253 | } |
251 | 254 | ||
@@ -261,9 +264,9 @@ QStringList TTSFestival::getVoiceList() | |||
261 | if (voices.size() == 1 && voices[0].size() == 0) | 264 | if (voices.size() == 1 && voices[0].size() == 0) |
262 | voices.removeAt(0); | 265 | voices.removeAt(0); |
263 | if (voices.size() > 0) | 266 | if (voices.size() > 0) |
264 | qDebug() << "[Festival] Voices: " << voices; | 267 | LOG_INFO() << "Voices:" << voices; |
265 | else | 268 | else |
266 | qDebug() << "[Festival] No voices. Response was: " << response; | 269 | LOG_WARNING() << "No voices. Response was:" << response; |
267 | 270 | ||
268 | return voices; | 271 | return voices; |
269 | } | 272 | } |
@@ -290,7 +293,7 @@ QString TTSFestival::getVoiceInfo(QString voice) | |||
290 | { | 293 | { |
291 | response = response.remove(QRegExp("(description \"*\")", | 294 | response = response.remove(QRegExp("(description \"*\")", |
292 | Qt::CaseInsensitive, QRegExp::Wildcard)); | 295 | Qt::CaseInsensitive, QRegExp::Wildcard)); |
293 | qDebug() << "[Festival] voiceInfo w/o descr: " << response; | 296 | LOG_INFO() << "voiceInfo w/o descr:" << response; |
294 | response = response.remove(')'); | 297 | response = response.remove(')'); |
295 | QStringList responseLines = response.split('(', QString::SkipEmptyParts); | 298 | QStringList responseLines = response.split('(', QString::SkipEmptyParts); |
296 | responseLines.removeAt(0); // the voice name itself | 299 | responseLines.removeAt(0); // the voice name itself |
@@ -327,12 +330,12 @@ QString TTSFestival::queryServer(QString query, int timeout) | |||
327 | 330 | ||
328 | // this operation could take some time | 331 | // this operation could take some time |
329 | emit busy(); | 332 | emit busy(); |
330 | 333 | ||
331 | qDebug() << "[Festival] queryServer with " << query; | 334 | LOG_INFO() << "queryServer with" << query; |
332 | 335 | ||
333 | if (!ensureServerRunning()) | 336 | if (!ensureServerRunning()) |
334 | { | 337 | { |
335 | qDebug() << "[Festival] queryServer: ensureServerRunning failed"; | 338 | LOG_ERROR() << "queryServer: ensureServerRunning failed"; |
336 | emit busyEnd(); | 339 | emit busyEnd(); |
337 | return ""; | 340 | return ""; |
338 | } | 341 | } |
@@ -393,7 +396,7 @@ QString TTSFestival::queryServer(QString query, int timeout) | |||
393 | lines.removeLast(); /* should be ft_StUfF_keyOK */ | 396 | lines.removeLast(); /* should be ft_StUfF_keyOK */ |
394 | } | 397 | } |
395 | else | 398 | else |
396 | qDebug() << "[Festival] Response too short: " << response; | 399 | LOG_ERROR() << "Response too short:" << response; |
397 | 400 | ||
398 | emit busyEnd(); | 401 | emit busyEnd(); |
399 | return lines.join("\n"); | 402 | return lines.join("\n"); |
diff --git a/rbutil/rbutilqt/base/ttssapi.cpp b/rbutil/rbutilqt/base/ttssapi.cpp index 603e7c5559..320ee1191a 100644 --- a/rbutil/rbutilqt/base/ttssapi.cpp +++ b/rbutil/rbutilqt/base/ttssapi.cpp | |||
@@ -20,6 +20,7 @@ | |||
20 | #include "utils.h" | 20 | #include "utils.h" |
21 | #include "rbsettings.h" | 21 | #include "rbsettings.h" |
22 | #include "systeminfo.h" | 22 | #include "systeminfo.h" |
23 | #include "Logger.h" | ||
23 | 24 | ||
24 | TTSSapi::TTSSapi(QObject* parent) : TTSBase(parent) | 25 | TTSSapi::TTSSapi(QObject* parent) : TTSBase(parent) |
25 | { | 26 | { |
@@ -89,7 +90,7 @@ void TTSSapi::saveSettings() | |||
89 | 90 | ||
90 | void TTSSapi::updateVoiceList() | 91 | void TTSSapi::updateVoiceList() |
91 | { | 92 | { |
92 | qDebug() << "[TTSSapi] updating voicelist"; | 93 | LOG_INFO() << "updating voicelist"; |
93 | QStringList voiceList = getVoiceList(getSetting(eLANGUAGE)->current().toString()); | 94 | QStringList voiceList = getVoiceList(getSetting(eLANGUAGE)->current().toString()); |
94 | getSetting(eVOICE)->setList(voiceList); | 95 | getSetting(eVOICE)->setList(voiceList); |
95 | if(voiceList.size() > 0) getSetting(eVOICE)->setCurrent(voiceList.at(0)); | 96 | if(voiceList.size() > 0) getSetting(eVOICE)->setCurrent(voiceList.at(0)); |
@@ -122,15 +123,15 @@ bool TTSSapi::start(QString *errStr) | |||
122 | execstring.replace("%voice",m_TTSVoice); | 123 | execstring.replace("%voice",m_TTSVoice); |
123 | execstring.replace("%speed",m_TTSSpeed); | 124 | execstring.replace("%speed",m_TTSSpeed); |
124 | 125 | ||
125 | qDebug() << "[TTSSapi] Start:" << execstring; | 126 | LOG_INFO() << "Start:" << execstring; |
126 | voicescript = new QProcess(NULL); | 127 | voicescript = new QProcess(NULL); |
127 | //connect(voicescript,SIGNAL(readyReadStandardError()),this,SLOT(error())); | 128 | //connect(voicescript,SIGNAL(readyReadStandardError()),this,SLOT(error())); |
128 | voicescript->start(execstring); | 129 | voicescript->start(execstring); |
129 | qDebug() << "[TTSSapi] wait for process"; | 130 | LOG_INFO() << "wait for process"; |
130 | if(!voicescript->waitForStarted()) | 131 | if(!voicescript->waitForStarted()) |
131 | { | 132 | { |
132 | *errStr = tr("Could not start SAPI process"); | 133 | *errStr = tr("Could not start SAPI process"); |
133 | qDebug() << "[TTSSapi] starting process timed out!"; | 134 | LOG_ERROR() << "starting process timed out!"; |
134 | return false; | 135 | return false; |
135 | } | 136 | } |
136 | 137 | ||
@@ -161,7 +162,7 @@ QString TTSSapi::voiceVendor(void) | |||
161 | while((vendor = voicestream->readLine()).isEmpty()) | 162 | while((vendor = voicestream->readLine()).isEmpty()) |
162 | QCoreApplication::processEvents(); | 163 | QCoreApplication::processEvents(); |
163 | 164 | ||
164 | qDebug() << "[TTSSAPI] TTS vendor:" << vendor; | 165 | LOG_INFO() << "TTS vendor:" << vendor; |
165 | if(!keeprunning) { | 166 | if(!keeprunning) { |
166 | stop(); | 167 | stop(); |
167 | } | 168 | } |
@@ -184,12 +185,12 @@ QStringList TTSSapi::getVoiceList(QString language) | |||
184 | execstring.replace("%exe",m_TTSexec); | 185 | execstring.replace("%exe",m_TTSexec); |
185 | execstring.replace("%lang",language); | 186 | execstring.replace("%lang",language); |
186 | 187 | ||
187 | qDebug() << "[TTSSapi] Start:" << execstring; | 188 | LOG_INFO() << "Start:" << execstring; |
188 | voicescript = new QProcess(NULL); | 189 | voicescript = new QProcess(NULL); |
189 | voicescript->start(execstring); | 190 | voicescript->start(execstring); |
190 | qDebug() << "[TTSSapi] wait for process"; | 191 | LOG_INFO() << "wait for process"; |
191 | if(!voicescript->waitForStarted()) { | 192 | if(!voicescript->waitForStarted()) { |
192 | qDebug() << "[TTSSapi] process startup timed out!"; | 193 | LOG_INFO() << "process startup timed out!"; |
193 | return result; | 194 | return result; |
194 | } | 195 | } |
195 | voicescript->closeWriteChannel(); | 196 | voicescript->closeWriteChannel(); |
@@ -197,7 +198,7 @@ QStringList TTSSapi::getVoiceList(QString language) | |||
197 | 198 | ||
198 | QString dataRaw = voicescript->readAllStandardError().data(); | 199 | QString dataRaw = voicescript->readAllStandardError().data(); |
199 | if(dataRaw.startsWith("Error")) { | 200 | if(dataRaw.startsWith("Error")) { |
200 | qDebug() << "[TTSSapi] Error:" << dataRaw; | 201 | LOG_INFO() << "Error:" << dataRaw; |
201 | } | 202 | } |
202 | result = dataRaw.split(";",QString::SkipEmptyParts); | 203 | result = dataRaw.split(";",QString::SkipEmptyParts); |
203 | if(result.size() > 0) | 204 | if(result.size() > 0) |
@@ -226,7 +227,7 @@ TTSStatus TTSSapi::voice(QString text,QString wavfile, QString *errStr) | |||
226 | { | 227 | { |
227 | (void) errStr; | 228 | (void) errStr; |
228 | QString query = "SPEAK\t"+wavfile+"\t"+text; | 229 | QString query = "SPEAK\t"+wavfile+"\t"+text; |
229 | qDebug() << "[TTSSapi] voicing" << query; | 230 | LOG_INFO() << "voicing" << query; |
230 | // append newline to query. Done now to keep debug output more readable. | 231 | // append newline to query. Done now to keep debug output more readable. |
231 | query.append("\r\n"); | 232 | query.append("\r\n"); |
232 | *voicestream << query; | 233 | *voicestream << query; |
@@ -236,7 +237,7 @@ TTSStatus TTSSapi::voice(QString text,QString wavfile, QString *errStr) | |||
236 | voicescript->waitForReadyRead(); | 237 | voicescript->waitForReadyRead(); |
237 | 238 | ||
238 | if(!QFileInfo(wavfile).isFile()) { | 239 | if(!QFileInfo(wavfile).isFile()) { |
239 | qDebug() << "[TTSSapi] output file does not exist:" << wavfile; | 240 | LOG_ERROR() << "output file does not exist:" << wavfile; |
240 | return FatalError; | 241 | return FatalError; |
241 | } | 242 | } |
242 | return NoError; | 243 | return NoError; |
diff --git a/rbutil/rbutilqt/base/uninstall.cpp b/rbutil/rbutilqt/base/uninstall.cpp index ef6eb61ca5..498edbb057 100644 --- a/rbutil/rbutilqt/base/uninstall.cpp +++ b/rbutil/rbutilqt/base/uninstall.cpp | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <QtCore> | 19 | #include <QtCore> |
20 | #include "uninstall.h" | 20 | #include "uninstall.h" |
21 | #include "utils.h" | 21 | #include "utils.h" |
22 | #include "Logger.h" | ||
22 | 23 | ||
23 | Uninstaller::Uninstaller(QObject* parent,QString mountpoint): QObject(parent) | 24 | Uninstaller::Uninstaller(QObject* parent,QString mountpoint): QObject(parent) |
24 | { | 25 | { |
@@ -66,7 +67,7 @@ void Uninstaller::uninstall(void) | |||
66 | if(installlog.contains(toDeleteList.at(j))) | 67 | if(installlog.contains(toDeleteList.at(j))) |
67 | { | 68 | { |
68 | deleteFile = false; | 69 | deleteFile = false; |
69 | qDebug() << "[Uninstaller] file still in use:" << toDeleteList.at(j); | 70 | LOG_INFO() << "file still in use:" << toDeleteList.at(j); |
70 | } | 71 | } |
71 | installlog.endGroup(); | 72 | installlog.endGroup(); |
72 | } | 73 | } |
@@ -79,7 +80,7 @@ void Uninstaller::uninstall(void) | |||
79 | emit logItem(tr("Could not delete %1") | 80 | emit logItem(tr("Could not delete %1") |
80 | .arg(toDelete.filePath()), LOGWARNING); | 81 | .arg(toDelete.filePath()), LOGWARNING); |
81 | installlog.remove(toDeleteList.at(j)); | 82 | installlog.remove(toDeleteList.at(j)); |
82 | qDebug() << "[Uninstaller] deleted:" << toDelete.filePath(); | 83 | LOG_INFO() << "deleted:" << toDelete.filePath(); |
83 | } | 84 | } |
84 | else // if it is a dir, remember it for later deletion | 85 | else // if it is a dir, remember it for later deletion |
85 | { | 86 | { |
diff --git a/rbutil/rbutilqt/base/utils.cpp b/rbutil/rbutilqt/base/utils.cpp index 1aeea7f18c..6a817e86da 100644 --- a/rbutil/rbutilqt/base/utils.cpp +++ b/rbutil/rbutilqt/base/utils.cpp | |||
@@ -21,6 +21,7 @@ | |||
21 | #include "system.h" | 21 | #include "system.h" |
22 | #include "rbsettings.h" | 22 | #include "rbsettings.h" |
23 | #include "systeminfo.h" | 23 | #include "systeminfo.h" |
24 | #include "Logger.h" | ||
24 | 25 | ||
25 | #ifdef UNICODE | 26 | #ifdef UNICODE |
26 | #define _UNICODE | 27 | #define _UNICODE |
@@ -125,7 +126,7 @@ QString Utils::resolvePathCase(QString path) | |||
125 | else | 126 | else |
126 | return QString(""); | 127 | return QString(""); |
127 | } | 128 | } |
128 | qDebug() << "[Utils] resolving path" << path << "->" << realpath; | 129 | LOG_INFO() << "resolving path" << path << "->" << realpath; |
129 | return realpath; | 130 | return realpath; |
130 | } | 131 | } |
131 | 132 | ||
@@ -179,7 +180,7 @@ QString Utils::filesystemName(QString path) | |||
179 | } while(result == noErr); | 180 | } while(result == noErr); |
180 | #endif | 181 | #endif |
181 | 182 | ||
182 | qDebug() << "[Utils] Volume name of" << path << "is" << name; | 183 | LOG_INFO() << "Volume name of" << path << "is" << name; |
183 | return name; | 184 | return name; |
184 | } | 185 | } |
185 | 186 | ||
@@ -190,7 +191,7 @@ QString Utils::filesystemName(QString path) | |||
190 | qulonglong Utils::filesystemFree(QString path) | 191 | qulonglong Utils::filesystemFree(QString path) |
191 | { | 192 | { |
192 | qulonglong size = filesystemSize(path, FilesystemFree); | 193 | qulonglong size = filesystemSize(path, FilesystemFree); |
193 | qDebug() << "[Utils] free disk space for" << path << size; | 194 | LOG_INFO() << "free disk space for" << path << size; |
194 | return size; | 195 | return size; |
195 | } | 196 | } |
196 | 197 | ||
@@ -198,7 +199,7 @@ qulonglong Utils::filesystemFree(QString path) | |||
198 | qulonglong Utils::filesystemTotal(QString path) | 199 | qulonglong Utils::filesystemTotal(QString path) |
199 | { | 200 | { |
200 | qulonglong size = filesystemSize(path, FilesystemTotal); | 201 | qulonglong size = filesystemSize(path, FilesystemTotal); |
201 | qDebug() << "[Utils] total disk space for" << path << size; | 202 | LOG_INFO() << "total disk space for" << path << size; |
202 | return size; | 203 | return size; |
203 | } | 204 | } |
204 | 205 | ||
@@ -206,7 +207,7 @@ qulonglong Utils::filesystemTotal(QString path) | |||
206 | qulonglong Utils::filesystemClusterSize(QString path) | 207 | qulonglong Utils::filesystemClusterSize(QString path) |
207 | { | 208 | { |
208 | qulonglong size = filesystemSize(path, FilesystemClusterSize); | 209 | qulonglong size = filesystemSize(path, FilesystemClusterSize); |
209 | qDebug() << "[Utils] cluster size for" << path << size; | 210 | LOG_INFO() << "cluster size for" << path << size; |
210 | return size; | 211 | return size; |
211 | } | 212 | } |
212 | 213 | ||
@@ -273,7 +274,7 @@ QString Utils::findExecutable(QString name) | |||
273 | #elif defined(Q_OS_WIN) | 274 | #elif defined(Q_OS_WIN) |
274 | QStringList path = QString(getenv("PATH")).split(";", QString::SkipEmptyParts); | 275 | QStringList path = QString(getenv("PATH")).split(";", QString::SkipEmptyParts); |
275 | #endif | 276 | #endif |
276 | qDebug() << "[Utils] system path:" << path; | 277 | LOG_INFO() << "system path:" << path; |
277 | for(int i = 0; i < path.size(); i++) | 278 | for(int i = 0; i < path.size(); i++) |
278 | { | 279 | { |
279 | QString executable = QDir::fromNativeSeparators(path.at(i)) + "/" + name; | 280 | QString executable = QDir::fromNativeSeparators(path.at(i)) + "/" + name; |
@@ -284,11 +285,11 @@ QString Utils::findExecutable(QString name) | |||
284 | #endif | 285 | #endif |
285 | if(QFileInfo(executable).isExecutable()) | 286 | if(QFileInfo(executable).isExecutable()) |
286 | { | 287 | { |
287 | qDebug() << "[Utils] findExecutable: found" << executable; | 288 | LOG_INFO() << "findExecutable: found" << executable; |
288 | return QDir::toNativeSeparators(executable); | 289 | return QDir::toNativeSeparators(executable); |
289 | } | 290 | } |
290 | } | 291 | } |
291 | qDebug() << "[Utils] findExecutable: could not find" << name; | 292 | LOG_INFO() << "findExecutable: could not find" << name; |
292 | return ""; | 293 | return ""; |
293 | } | 294 | } |
294 | 295 | ||
@@ -299,7 +300,7 @@ QString Utils::findExecutable(QString name) | |||
299 | */ | 300 | */ |
300 | QString Utils::checkEnvironment(bool permission) | 301 | QString Utils::checkEnvironment(bool permission) |
301 | { | 302 | { |
302 | qDebug() << "[Utils] checking environment"; | 303 | LOG_INFO() << "checking environment"; |
303 | QString text = ""; | 304 | QString text = ""; |
304 | 305 | ||
305 | // check permission | 306 | // check permission |
@@ -338,7 +339,7 @@ QString Utils::checkEnvironment(bool permission) | |||
338 | */ | 339 | */ |
339 | int Utils::compareVersionStrings(QString s1, QString s2) | 340 | int Utils::compareVersionStrings(QString s1, QString s2) |
340 | { | 341 | { |
341 | qDebug() << "[Utils] comparing version strings" << s1 << "and" << s2; | 342 | LOG_INFO() << "comparing version strings" << s1 << "and" << s2; |
342 | QString a = s1.trimmed(); | 343 | QString a = s1.trimmed(); |
343 | QString b = s2.trimmed(); | 344 | QString b = s2.trimmed(); |
344 | // if strings are identical return 0. | 345 | // if strings are identical return 0. |
@@ -418,7 +419,7 @@ int Utils::compareVersionStrings(QString s1, QString s2) | |||
418 | */ | 419 | */ |
419 | QString Utils::resolveDevicename(QString path) | 420 | QString Utils::resolveDevicename(QString path) |
420 | { | 421 | { |
421 | qDebug() << "[Utils] resolving device name" << path; | 422 | LOG_INFO() << "resolving device name" << path; |
422 | #if defined(Q_OS_LINUX) | 423 | #if defined(Q_OS_LINUX) |
423 | FILE *mn = setmntent("/etc/mtab", "r"); | 424 | FILE *mn = setmntent("/etc/mtab", "r"); |
424 | if(!mn) | 425 | if(!mn) |
@@ -434,7 +435,7 @@ QString Utils::resolveDevicename(QString path) | |||
434 | && (QString(ent->mnt_type).contains("vfat", Qt::CaseInsensitive) | 435 | && (QString(ent->mnt_type).contains("vfat", Qt::CaseInsensitive) |
435 | || QString(ent->mnt_type).contains("hfs", Qt::CaseInsensitive))) { | 436 | || QString(ent->mnt_type).contains("hfs", Qt::CaseInsensitive))) { |
436 | endmntent(mn); | 437 | endmntent(mn); |
437 | qDebug() << "[Utils] device name is" << ent->mnt_fsname; | 438 | LOG_INFO() << "device name is" << ent->mnt_fsname; |
438 | return QString(ent->mnt_fsname); | 439 | return QString(ent->mnt_fsname); |
439 | } | 440 | } |
440 | } | 441 | } |
@@ -453,7 +454,7 @@ QString Utils::resolveDevicename(QString path) | |||
453 | if(QString(mntinf->f_mntonname) == path | 454 | if(QString(mntinf->f_mntonname) == path |
454 | && (QString(mntinf->f_fstypename).contains("msdos", Qt::CaseInsensitive) | 455 | && (QString(mntinf->f_fstypename).contains("msdos", Qt::CaseInsensitive) |
455 | || QString(mntinf->f_fstypename).contains("hfs", Qt::CaseInsensitive))) { | 456 | || QString(mntinf->f_fstypename).contains("hfs", Qt::CaseInsensitive))) { |
456 | qDebug() << "[Utils] device name is" << mntinf->f_mntfromname; | 457 | LOG_INFO() << "device name is" << mntinf->f_mntfromname; |
457 | return QString(mntinf->f_mntfromname); | 458 | return QString(mntinf->f_mntfromname); |
458 | } | 459 | } |
459 | mntinf++; | 460 | mntinf++; |
@@ -471,17 +472,17 @@ QString Utils::resolveDevicename(QString path) | |||
471 | h = CreateFile(uncpath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, | 472 | h = CreateFile(uncpath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, |
472 | NULL, OPEN_EXISTING, 0, NULL); | 473 | NULL, OPEN_EXISTING, 0, NULL); |
473 | if(h == INVALID_HANDLE_VALUE) { | 474 | if(h == INVALID_HANDLE_VALUE) { |
474 | //qDebug() << "error getting extents for" << uncpath; | 475 | //LOG_INFO() << "error getting extents for" << uncpath; |
475 | return ""; | 476 | return ""; |
476 | } | 477 | } |
477 | // get the extents | 478 | // get the extents |
478 | if(DeviceIoControl(h, IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS, | 479 | if(DeviceIoControl(h, IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS, |
479 | NULL, 0, extents, sizeof(buffer), &written, NULL)) { | 480 | NULL, 0, extents, sizeof(buffer), &written, NULL)) { |
480 | if(extents->NumberOfDiskExtents > 1) { | 481 | if(extents->NumberOfDiskExtents > 1) { |
481 | qDebug() << "[Utils] resolving device name: volume spans multiple disks!"; | 482 | LOG_INFO() << "resolving device name: volume spans multiple disks!"; |
482 | return ""; | 483 | return ""; |
483 | } | 484 | } |
484 | qDebug() << "[Utils] device name is" << extents->Extents[0].DiskNumber; | 485 | LOG_INFO() << "device name is" << extents->Extents[0].DiskNumber; |
485 | return QString("%1").arg(extents->Extents[0].DiskNumber); | 486 | return QString("%1").arg(extents->Extents[0].DiskNumber); |
486 | } | 487 | } |
487 | #endif | 488 | #endif |
@@ -496,7 +497,7 @@ QString Utils::resolveDevicename(QString path) | |||
496 | */ | 497 | */ |
497 | QString Utils::resolveMountPoint(QString device) | 498 | QString Utils::resolveMountPoint(QString device) |
498 | { | 499 | { |
499 | qDebug() << "[Utils] resolving mountpoint:" << device; | 500 | LOG_INFO() << "resolving mountpoint:" << device; |
500 | 501 | ||
501 | #if defined(Q_OS_LINUX) | 502 | #if defined(Q_OS_LINUX) |
502 | FILE *mn = setmntent("/etc/mtab", "r"); | 503 | FILE *mn = setmntent("/etc/mtab", "r"); |
@@ -511,11 +512,11 @@ QString Utils::resolveMountPoint(QString device) | |||
511 | QString result; | 512 | QString result; |
512 | if(QString(ent->mnt_type).contains("vfat", Qt::CaseInsensitive) | 513 | if(QString(ent->mnt_type).contains("vfat", Qt::CaseInsensitive) |
513 | || QString(ent->mnt_type).contains("hfs", Qt::CaseInsensitive)) { | 514 | || QString(ent->mnt_type).contains("hfs", Qt::CaseInsensitive)) { |
514 | qDebug() << "[Utils] resolved mountpoint is:" << ent->mnt_dir; | 515 | LOG_INFO() << "resolved mountpoint is:" << ent->mnt_dir; |
515 | result = QString(ent->mnt_dir); | 516 | result = QString(ent->mnt_dir); |
516 | } | 517 | } |
517 | else { | 518 | else { |
518 | qDebug() << "[Utils] mountpoint is wrong filesystem!"; | 519 | LOG_INFO() << "mountpoint is wrong filesystem!"; |
519 | } | 520 | } |
520 | endmntent(mn); | 521 | endmntent(mn); |
521 | return result; | 522 | return result; |
@@ -536,11 +537,11 @@ QString Utils::resolveMountPoint(QString device) | |||
536 | if(QString(mntinf->f_mntfromname) == device) { | 537 | if(QString(mntinf->f_mntfromname) == device) { |
537 | if(QString(mntinf->f_fstypename).contains("msdos", Qt::CaseInsensitive) | 538 | if(QString(mntinf->f_fstypename).contains("msdos", Qt::CaseInsensitive) |
538 | || QString(mntinf->f_fstypename).contains("hfs", Qt::CaseInsensitive)) { | 539 | || QString(mntinf->f_fstypename).contains("hfs", Qt::CaseInsensitive)) { |
539 | qDebug() << "[Utils] resolved mountpoint is:" << mntinf->f_mntonname; | 540 | LOG_INFO() << "resolved mountpoint is:" << mntinf->f_mntonname; |
540 | return QString(mntinf->f_mntonname); | 541 | return QString(mntinf->f_mntonname); |
541 | } | 542 | } |
542 | else { | 543 | else { |
543 | qDebug() << "[Utils] mountpoint is wrong filesystem!"; | 544 | LOG_INFO() << "mountpoint is wrong filesystem!"; |
544 | return QString(); | 545 | return QString(); |
545 | } | 546 | } |
546 | } | 547 | } |
@@ -556,14 +557,14 @@ QString Utils::resolveMountPoint(QString device) | |||
556 | for(letter = 'A'; letter <= 'Z'; letter++) { | 557 | for(letter = 'A'; letter <= 'Z'; letter++) { |
557 | if(resolveDevicename(QString(letter)).toUInt() == driveno) { | 558 | if(resolveDevicename(QString(letter)).toUInt() == driveno) { |
558 | result = letter; | 559 | result = letter; |
559 | qDebug() << "[Utils] resolved mountpoint is:" << result; | 560 | LOG_INFO() << "resolved mountpoint is:" << result; |
560 | break; | 561 | break; |
561 | } | 562 | } |
562 | } | 563 | } |
563 | if(!result.isEmpty()) | 564 | if(!result.isEmpty()) |
564 | return result + ":/"; | 565 | return result + ":/"; |
565 | #endif | 566 | #endif |
566 | qDebug() << "[Utils] resolving mountpoint failed!"; | 567 | LOG_INFO() << "resolving mountpoint failed!"; |
567 | return QString(""); | 568 | return QString(""); |
568 | } | 569 | } |
569 | 570 | ||
@@ -589,11 +590,11 @@ QStringList Utils::mountpoints(enum MountpointsFilter type) | |||
589 | QString fstype = QString::fromWCharArray(t); | 590 | QString fstype = QString::fromWCharArray(t); |
590 | if(type == MountpointsAll || supported.contains(fstype)) { | 591 | if(type == MountpointsAll || supported.contains(fstype)) { |
591 | tempList << list.at(i).absolutePath(); | 592 | tempList << list.at(i).absolutePath(); |
592 | qDebug() << "[Utils] Added:" << list.at(i).absolutePath() | 593 | LOG_INFO() << "Added:" << list.at(i).absolutePath() |
593 | << "type" << fstype; | 594 | << "type" << fstype; |
594 | } | 595 | } |
595 | else { | 596 | else { |
596 | qDebug() << "[Utils] Ignored:" << list.at(i).absolutePath() | 597 | LOG_INFO() << "Ignored:" << list.at(i).absolutePath() |
597 | << "type" << fstype; | 598 | << "type" << fstype; |
598 | } | 599 | } |
599 | } | 600 | } |
@@ -607,11 +608,11 @@ QStringList Utils::mountpoints(enum MountpointsFilter type) | |||
607 | while(num--) { | 608 | while(num--) { |
608 | if(type == MountpointsAll || supported.contains(mntinf->f_fstypename)) { | 609 | if(type == MountpointsAll || supported.contains(mntinf->f_fstypename)) { |
609 | tempList << QString(mntinf->f_mntonname); | 610 | tempList << QString(mntinf->f_mntonname); |
610 | qDebug() << "[Utils] Added:" << mntinf->f_mntonname | 611 | LOG_INFO() << "Added:" << mntinf->f_mntonname |
611 | << "is" << mntinf->f_mntfromname << "type" << mntinf->f_fstypename; | 612 | << "is" << mntinf->f_mntfromname << "type" << mntinf->f_fstypename; |
612 | } | 613 | } |
613 | else { | 614 | else { |
614 | qDebug() << "[Utils] Ignored:" << mntinf->f_mntonname | 615 | LOG_INFO() << "Ignored:" << mntinf->f_mntonname |
615 | << "is" << mntinf->f_mntfromname << "type" << mntinf->f_fstypename; | 616 | << "is" << mntinf->f_mntfromname << "type" << mntinf->f_fstypename; |
616 | } | 617 | } |
617 | mntinf++; | 618 | mntinf++; |
@@ -626,11 +627,11 @@ QStringList Utils::mountpoints(enum MountpointsFilter type) | |||
626 | while((ent = getmntent(mn))) { | 627 | while((ent = getmntent(mn))) { |
627 | if(type == MountpointsAll || supported.contains(ent->mnt_type)) { | 628 | if(type == MountpointsAll || supported.contains(ent->mnt_type)) { |
628 | tempList << QString(ent->mnt_dir); | 629 | tempList << QString(ent->mnt_dir); |
629 | qDebug() << "[Utils] Added:" << ent->mnt_dir | 630 | LOG_INFO() << "Added:" << ent->mnt_dir |
630 | << "is" << ent->mnt_fsname << "type" << ent->mnt_type; | 631 | << "is" << ent->mnt_fsname << "type" << ent->mnt_type; |
631 | } | 632 | } |
632 | else { | 633 | else { |
633 | qDebug() << "[Utils] Ignored:" << ent->mnt_dir | 634 | LOG_INFO() << "Ignored:" << ent->mnt_dir |
634 | << "is" << ent->mnt_fsname << "type" << ent->mnt_type; | 635 | << "is" << ent->mnt_fsname << "type" << ent->mnt_type; |
635 | } | 636 | } |
636 | } | 637 | } |
@@ -658,13 +659,13 @@ QStringList Utils::findRunningProcess(QStringList names) | |||
658 | 659 | ||
659 | hdl = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); | 660 | hdl = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); |
660 | if(hdl == INVALID_HANDLE_VALUE) { | 661 | if(hdl == INVALID_HANDLE_VALUE) { |
661 | qDebug() << "[Utils] CreateToolhelp32Snapshot failed."; | 662 | LOG_ERROR() << "CreateToolhelp32Snapshot failed."; |
662 | return found; | 663 | return found; |
663 | } | 664 | } |
664 | entry.dwSize = sizeof(PROCESSENTRY32); | 665 | entry.dwSize = sizeof(PROCESSENTRY32); |
665 | entry.szExeFile[0] = '\0'; | 666 | entry.szExeFile[0] = '\0'; |
666 | if(!Process32First(hdl, &entry)) { | 667 | if(!Process32First(hdl, &entry)) { |
667 | qDebug() << "[Utils] Process32First failed."; | 668 | LOG_ERROR() << "Process32First failed."; |
668 | return found; | 669 | return found; |
669 | } | 670 | } |
670 | 671 | ||
@@ -721,7 +722,7 @@ QStringList Utils::findRunningProcess(QStringList names) | |||
721 | found.append(processlist.at(index)); | 722 | found.append(processlist.at(index)); |
722 | } | 723 | } |
723 | } | 724 | } |
724 | qDebug() << "[Utils] Found listed processes running:" << found; | 725 | LOG_INFO() << "Found listed processes running:" << found; |
725 | return found; | 726 | return found; |
726 | } | 727 | } |
727 | 728 | ||
diff --git a/rbutil/rbutilqt/base/voicefile.cpp b/rbutil/rbutilqt/base/voicefile.cpp index 70c0f7b653..814ac538e2 100644 --- a/rbutil/rbutilqt/base/voicefile.cpp +++ b/rbutil/rbutilqt/base/voicefile.cpp | |||
@@ -23,6 +23,7 @@ | |||
23 | #include "rbsettings.h" | 23 | #include "rbsettings.h" |
24 | #include "systeminfo.h" | 24 | #include "systeminfo.h" |
25 | #include "ziputil.h" | 25 | #include "ziputil.h" |
26 | #include "Logger.h" | ||
26 | 27 | ||
27 | VoiceFileCreator::VoiceFileCreator(QObject* parent) :QObject(parent) | 28 | VoiceFileCreator::VoiceFileCreator(QObject* parent) :QObject(parent) |
28 | { | 29 | { |
@@ -65,7 +66,7 @@ bool VoiceFileCreator::createVoiceFile() | |||
65 | 66 | ||
66 | // check if voicefile is present on target | 67 | // check if voicefile is present on target |
67 | QString fn = m_mountpoint + "/.rockbox/langs/voicestrings.zip"; | 68 | QString fn = m_mountpoint + "/.rockbox/langs/voicestrings.zip"; |
68 | qDebug() << "[VoiceFile] searching for zipped voicestrings at" << fn; | 69 | LOG_INFO() << "searching for zipped voicestrings at" << fn; |
69 | if(QFileInfo(fn).isFile()) { | 70 | if(QFileInfo(fn).isFile()) { |
70 | // search for binary voice strings file in archive | 71 | // search for binary voice strings file in archive |
71 | ZipUtil z(this); | 72 | ZipUtil z(this); |
@@ -79,7 +80,7 @@ bool VoiceFileCreator::createVoiceFile() | |||
79 | } | 80 | } |
80 | } | 81 | } |
81 | if(index < contents.size()) { | 82 | if(index < contents.size()) { |
82 | qDebug() << "[VoiceFile] extracting strings file from zip"; | 83 | LOG_INFO() << "extracting strings file from zip"; |
83 | // extract strings | 84 | // extract strings |
84 | QTemporaryFile stringsfile; | 85 | QTemporaryFile stringsfile; |
85 | stringsfile.open(); | 86 | stringsfile.open(); |
@@ -153,7 +154,7 @@ bool VoiceFileCreator::createVoiceFile() | |||
153 | genlang.replace("%REVISION%", version); | 154 | genlang.replace("%REVISION%", version); |
154 | genlang.replace("%FEATURES%", features); | 155 | genlang.replace("%FEATURES%", features); |
155 | QUrl genlangUrl(genlang); | 156 | QUrl genlangUrl(genlang); |
156 | qDebug() << "[VoiceFileCreator] downloading" << genlangUrl; | 157 | LOG_INFO() << "downloading" << genlangUrl; |
157 | 158 | ||
158 | //download the correct genlang output | 159 | //download the correct genlang output |
159 | QTemporaryFile *downloadFile = new QTemporaryFile(this); | 160 | QTemporaryFile *downloadFile = new QTemporaryFile(this); |
@@ -175,7 +176,7 @@ bool VoiceFileCreator::createVoiceFile() | |||
175 | 176 | ||
176 | void VoiceFileCreator::downloadDone(bool error) | 177 | void VoiceFileCreator::downloadDone(bool error) |
177 | { | 178 | { |
178 | qDebug() << "[VoiceFileCreator] download done, error:" << error; | 179 | LOG_INFO() << "download done, error:" << error; |
179 | 180 | ||
180 | // update progress bar | 181 | // update progress bar |
181 | emit logProgress(1,1); | 182 | emit logProgress(1,1); |
@@ -253,7 +254,7 @@ void VoiceFileCreator::create(void) | |||
253 | m_talkList.append(entry); | 254 | m_talkList.append(entry); |
254 | } | 255 | } |
255 | else if(entry.toSpeak.isEmpty()) { | 256 | else if(entry.toSpeak.isEmpty()) { |
256 | qDebug() << "[Voicefile] Empty voice string for ID" << id; | 257 | LOG_WARNING() << "Empty voice string for ID" << id; |
257 | } | 258 | } |
258 | else { | 259 | else { |
259 | m_talkList.append(entry); | 260 | m_talkList.append(entry); |
@@ -314,7 +315,7 @@ void VoiceFileCreator::create(void) | |||
314 | return; | 315 | return; |
315 | } | 316 | } |
316 | 317 | ||
317 | qDebug() << "[VoiceFile] Running voicefont, format" << m_voiceformat; | 318 | LOG_INFO() << "Running voicefont, format" << m_voiceformat; |
318 | voicefont(ids2,m_targetid,m_path.toLocal8Bit().data(), output, m_voiceformat); | 319 | voicefont(ids2,m_targetid,m_path.toLocal8Bit().data(), output, m_voiceformat); |
319 | // ids2 and output are closed by voicefont(). | 320 | // ids2 and output are closed by voicefont(). |
320 | 321 | ||
diff --git a/rbutil/rbutilqt/base/zipinstaller.cpp b/rbutil/rbutilqt/base/zipinstaller.cpp index e24199408e..b2c8e09178 100644 --- a/rbutil/rbutilqt/base/zipinstaller.cpp +++ b/rbutil/rbutilqt/base/zipinstaller.cpp | |||
@@ -20,6 +20,7 @@ | |||
20 | #include "zipinstaller.h" | 20 | #include "zipinstaller.h" |
21 | #include "utils.h" | 21 | #include "utils.h" |
22 | #include "ziputil.h" | 22 | #include "ziputil.h" |
23 | #include "Logger.h" | ||
23 | 24 | ||
24 | ZipInstaller::ZipInstaller(QObject* parent): QObject(parent) | 25 | ZipInstaller::ZipInstaller(QObject* parent): QObject(parent) |
25 | { | 26 | { |
@@ -31,7 +32,7 @@ ZipInstaller::ZipInstaller(QObject* parent): QObject(parent) | |||
31 | 32 | ||
32 | void ZipInstaller::install() | 33 | void ZipInstaller::install() |
33 | { | 34 | { |
34 | qDebug() << "[ZipInstall] initializing installation"; | 35 | LOG_INFO() << "initializing installation"; |
35 | 36 | ||
36 | runner = 0; | 37 | runner = 0; |
37 | connect(this, SIGNAL(cont()), this, SLOT(installContinue())); | 38 | connect(this, SIGNAL(cont()), this, SLOT(installContinue())); |
@@ -44,17 +45,17 @@ void ZipInstaller::install() | |||
44 | 45 | ||
45 | void ZipInstaller::abort() | 46 | void ZipInstaller::abort() |
46 | { | 47 | { |
47 | qDebug() << "[ZipInstall] Aborted"; | 48 | LOG_INFO() << "Aborted"; |
48 | emit internalAborted(); | 49 | emit internalAborted(); |
49 | } | 50 | } |
50 | 51 | ||
51 | 52 | ||
52 | void ZipInstaller::installContinue() | 53 | void ZipInstaller::installContinue() |
53 | { | 54 | { |
54 | qDebug() << "[ZipInstall] continuing installation"; | 55 | LOG_INFO() << "continuing installation"; |
55 | 56 | ||
56 | runner++; // this gets called when a install finished, so increase first. | 57 | runner++; // this gets called when a install finished, so increase first. |
57 | qDebug() << "[ZipInstall] runner done:" << runner << "/" << m_urllist.size(); | 58 | LOG_INFO() << "runner done:" << runner << "/" << m_urllist.size(); |
58 | if(runner < m_urllist.size()) { | 59 | if(runner < m_urllist.size()) { |
59 | emit logItem(tr("done."), LOGOK); | 60 | emit logItem(tr("done."), LOGOK); |
60 | m_url = m_urllist.at(runner); | 61 | m_url = m_urllist.at(runner); |
@@ -74,7 +75,7 @@ void ZipInstaller::installContinue() | |||
74 | 75 | ||
75 | void ZipInstaller::installStart() | 76 | void ZipInstaller::installStart() |
76 | { | 77 | { |
77 | qDebug() << "[ZipInstall] starting installation"; | 78 | LOG_INFO() << "starting installation"; |
78 | 79 | ||
79 | emit logItem(tr("Downloading file %1.%2").arg(QFileInfo(m_url).baseName(), | 80 | emit logItem(tr("Downloading file %1.%2").arg(QFileInfo(m_url).baseName(), |
80 | QFileInfo(m_url).completeSuffix()),LOGINFO); | 81 | QFileInfo(m_url).completeSuffix()),LOGINFO); |
@@ -105,7 +106,7 @@ void ZipInstaller::installStart() | |||
105 | 106 | ||
106 | void ZipInstaller::downloadDone(bool error) | 107 | void ZipInstaller::downloadDone(bool error) |
107 | { | 108 | { |
108 | qDebug() << "[ZipInstall] download done, error:" << error; | 109 | LOG_INFO() << "download done, error:" << error; |
109 | QStringList zipContents; // needed later | 110 | QStringList zipContents; // needed later |
110 | // update progress bar | 111 | // update progress bar |
111 | 112 | ||
@@ -127,7 +128,7 @@ void ZipInstaller::downloadDone(bool error) | |||
127 | QCoreApplication::processEvents(); | 128 | QCoreApplication::processEvents(); |
128 | if(m_unzip) { | 129 | if(m_unzip) { |
129 | // unzip downloaded file | 130 | // unzip downloaded file |
130 | qDebug() << "[ZipInstall] about to unzip " << m_file << "to" << m_mountpoint; | 131 | LOG_INFO() << "about to unzip" << m_file << "to" << m_mountpoint; |
131 | 132 | ||
132 | emit logItem(tr("Extracting file."), LOGINFO); | 133 | emit logItem(tr("Extracting file."), LOGINFO); |
133 | QCoreApplication::processEvents(); | 134 | QCoreApplication::processEvents(); |
@@ -159,7 +160,7 @@ void ZipInstaller::downloadDone(bool error) | |||
159 | else { | 160 | else { |
160 | // only copy the downloaded file to the output location / name | 161 | // only copy the downloaded file to the output location / name |
161 | emit logItem(tr("Installing file."), LOGINFO); | 162 | emit logItem(tr("Installing file."), LOGINFO); |
162 | qDebug() << "[ZipInstall] saving downloaded file (no extraction)"; | 163 | LOG_INFO() << "saving downloaded file (no extraction)"; |
163 | 164 | ||
164 | m_downloadFile->open(); // copy fails if file is not opened (filename issue?) | 165 | m_downloadFile->open(); // copy fails if file is not opened (filename issue?) |
165 | // make sure the required path is existing | 166 | // make sure the required path is existing |
diff --git a/rbutil/rbutilqt/base/zipinstaller.h b/rbutil/rbutilqt/base/zipinstaller.h index 4ea08fbe53..97a5156ee8 100644 --- a/rbutil/rbutilqt/base/zipinstaller.h +++ b/rbutil/rbutilqt/base/zipinstaller.h | |||
@@ -26,6 +26,7 @@ | |||
26 | 26 | ||
27 | #include "progressloggerinterface.h" | 27 | #include "progressloggerinterface.h" |
28 | #include "httpget.h" | 28 | #include "httpget.h" |
29 | #include "Logger.h" | ||
29 | 30 | ||
30 | class ZipInstaller : public QObject | 31 | class ZipInstaller : public QObject |
31 | { | 32 | { |
@@ -40,9 +41,9 @@ public: | |||
40 | void setLogSection(QString name) {m_loglist = QStringList(name);} | 41 | void setLogSection(QString name) {m_loglist = QStringList(name);} |
41 | void setLogSection(QStringList name) { m_loglist = name; } | 42 | void setLogSection(QStringList name) { m_loglist = name; } |
42 | void setLogVersion(QString v = "") | 43 | void setLogVersion(QString v = "") |
43 | { m_verlist = QStringList(v); qDebug() << m_verlist;} | 44 | { m_verlist = QStringList(v); LOG_INFO() << m_verlist;} |
44 | void setLogVersion(QStringList v) | 45 | void setLogVersion(QStringList v) |
45 | { m_verlist = v; qDebug() << m_verlist;} | 46 | { m_verlist = v; LOG_INFO() << m_verlist;} |
46 | void setUnzip(bool i) { m_unzip = i; } | 47 | void setUnzip(bool i) { m_unzip = i; } |
47 | void setTarget(QString t) { m_target = t; } | 48 | void setTarget(QString t) { m_target = t; } |
48 | void setCache(QDir c) { m_cache = c; m_usecache = true; }; | 49 | void setCache(QDir c) { m_cache = c; m_usecache = true; }; |
diff --git a/rbutil/rbutilqt/base/ziputil.cpp b/rbutil/rbutilqt/base/ziputil.cpp index b93d5fd86a..b6cfdddce2 100644 --- a/rbutil/rbutilqt/base/ziputil.cpp +++ b/rbutil/rbutilqt/base/ziputil.cpp | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <QDebug> | 20 | #include <QDebug> |
21 | #include "ziputil.h" | 21 | #include "ziputil.h" |
22 | #include "progressloggerinterface.h" | 22 | #include "progressloggerinterface.h" |
23 | #include "Logger.h" | ||
23 | 24 | ||
24 | #include "quazip/quazip.h" | 25 | #include "quazip/quazip.h" |
25 | #include "quazip/quazipfile.h" | 26 | #include "quazip/quazipfile.h" |
@@ -76,7 +77,7 @@ bool ZipUtil::close(void) | |||
76 | //! @return true on success, false otherwise | 77 | //! @return true on success, false otherwise |
77 | bool ZipUtil::extractArchive(const QString& dest, QString file) | 78 | bool ZipUtil::extractArchive(const QString& dest, QString file) |
78 | { | 79 | { |
79 | qDebug() << "[ZipUtil] extractArchive" << dest << file; | 80 | LOG_INFO() << "extractArchive" << dest << file; |
80 | bool result = true; | 81 | bool result = true; |
81 | if(!m_zip) { | 82 | if(!m_zip) { |
82 | return false; | 83 | return false; |
@@ -122,15 +123,15 @@ bool ZipUtil::extractArchive(const QString& dest, QString file) | |||
122 | if(!QDir().mkpath(QFileInfo(outfilename).absolutePath())) { | 123 | if(!QDir().mkpath(QFileInfo(outfilename).absolutePath())) { |
123 | result = false; | 124 | result = false; |
124 | emit logItem(tr("Creating output path failed"), LOGERROR); | 125 | emit logItem(tr("Creating output path failed"), LOGERROR); |
125 | qDebug() << "[ZipUtil] creating output path failed for:" | 126 | LOG_INFO() << "creating output path failed for:" |
126 | << outfilename; | 127 | << outfilename; |
127 | break; | 128 | break; |
128 | } | 129 | } |
129 | if(!outputFile.open(QFile::WriteOnly)) { | 130 | if(!outputFile.open(QFile::WriteOnly)) { |
130 | result = false; | 131 | result = false; |
131 | emit logItem(tr("Creating output file failed"), LOGERROR); | 132 | emit logItem(tr("Creating output file failed"), LOGERROR); |
132 | qDebug() << "[ZipUtil] creating output file failed:" | 133 | LOG_INFO() << "creating output file failed:" |
133 | << outfilename; | 134 | << outfilename; |
134 | break; | 135 | break; |
135 | } | 136 | } |
136 | currentFile->open(QIODevice::ReadOnly); | 137 | currentFile->open(QIODevice::ReadOnly); |
@@ -138,8 +139,8 @@ bool ZipUtil::extractArchive(const QString& dest, QString file) | |||
138 | if(currentFile->getZipError() != UNZ_OK) { | 139 | if(currentFile->getZipError() != UNZ_OK) { |
139 | result = false; | 140 | result = false; |
140 | emit logItem(tr("Error during Zip operation"), LOGERROR); | 141 | emit logItem(tr("Error during Zip operation"), LOGERROR); |
141 | qDebug() << "[ZipUtil] QuaZip error:" << currentFile->getZipError() | 142 | LOG_INFO() << "QuaZip error:" << currentFile->getZipError() |
142 | << "on file" << currentFile->getFileName(); | 143 | << "on file" << currentFile->getFileName(); |
143 | break; | 144 | break; |
144 | } | 145 | } |
145 | currentFile->close(); | 146 | currentFile->close(); |
@@ -162,7 +163,7 @@ bool ZipUtil::appendDirToArchive(QString& source, QString& basedir) | |||
162 | { | 163 | { |
163 | bool result = true; | 164 | bool result = true; |
164 | if(!m_zip || !m_zip->isOpen()) { | 165 | if(!m_zip || !m_zip->isOpen()) { |
165 | qDebug() << "[ZipUtil] Zip file not open!"; | 166 | LOG_INFO() << "Zip file not open!"; |
166 | return false; | 167 | return false; |
167 | } | 168 | } |
168 | // get a list of all files and folders. Needed for progress info and avoids | 169 | // get a list of all files and folders. Needed for progress info and avoids |
@@ -176,14 +177,14 @@ bool ZipUtil::appendDirToArchive(QString& source, QString& basedir) | |||
176 | fileList.append(iterator.filePath()); | 177 | fileList.append(iterator.filePath()); |
177 | } | 178 | } |
178 | } | 179 | } |
179 | qDebug() << "[ZipUtil] Adding" << fileList.size() << "files to archive"; | 180 | LOG_INFO() << "Adding" << fileList.size() << "files to archive"; |
180 | 181 | ||
181 | int max = fileList.size(); | 182 | int max = fileList.size(); |
182 | for(int i = 0; i < max; i++) { | 183 | for(int i = 0; i < max; i++) { |
183 | QString current = fileList.at(i); | 184 | QString current = fileList.at(i); |
184 | if(!appendFileToArchive(current, basedir)) { | 185 | if(!appendFileToArchive(current, basedir)) { |
185 | qDebug() << "[ZipUtil] Error appending file" << current | 186 | LOG_ERROR() << "Error appending file" << current |
186 | << "to archive" << m_zip->getZipName(); | 187 | << "to archive" << m_zip->getZipName(); |
187 | result = false; | 188 | result = false; |
188 | break; | 189 | break; |
189 | } | 190 | } |
@@ -199,7 +200,7 @@ bool ZipUtil::appendFileToArchive(QString& file, QString& basedir) | |||
199 | { | 200 | { |
200 | bool result = true; | 201 | bool result = true; |
201 | if(!m_zip || !m_zip->isOpen()) { | 202 | if(!m_zip || !m_zip->isOpen()) { |
202 | qDebug() << "[ZipUtil] Zip file not open!"; | 203 | LOG_ERROR() << "Zip file not open!"; |
203 | return false; | 204 | return false; |
204 | } | 205 | } |
205 | // skip folders, we can't add them. | 206 | // skip folders, we can't add them. |
@@ -215,12 +216,12 @@ bool ZipUtil::appendFileToArchive(QString& file, QString& basedir) | |||
215 | QFile fin(file); | 216 | QFile fin(file); |
216 | 217 | ||
217 | if(!fin.open(QFile::ReadOnly)) { | 218 | if(!fin.open(QFile::ReadOnly)) { |
218 | qDebug() << "[ZipUtil] Could not open file for reading:" << file; | 219 | LOG_ERROR() << "Could not open file for reading:" << file; |
219 | return false; | 220 | return false; |
220 | } | 221 | } |
221 | if(!fout.open(QIODevice::WriteOnly, QuaZipNewInfo(newfile, infile))) { | 222 | if(!fout.open(QIODevice::WriteOnly, QuaZipNewInfo(newfile, infile))) { |
222 | fin.close(); | 223 | fin.close(); |
223 | qDebug() << "[ZipUtil] Could not open file for writing:" << newfile; | 224 | LOG_ERROR() << "Could not open file for writing:" << newfile; |
224 | return false; | 225 | return false; |
225 | } | 226 | } |
226 | 227 | ||
@@ -253,11 +254,11 @@ qint64 ZipUtil::totalUncompressedSize(unsigned int clustersize) | |||
253 | } | 254 | } |
254 | } | 255 | } |
255 | if(clustersize > 0) { | 256 | if(clustersize > 0) { |
256 | qDebug() << "[ZipUtil] calculation rounded to cluster size for each file:" | 257 | LOG_INFO() << "calculation rounded to cluster size for each file:" |
257 | << clustersize; | 258 | << clustersize; |
258 | } | 259 | } |
259 | qDebug() << "[ZipUtil] size of archive files uncompressed:" | 260 | LOG_INFO() << "size of archive files uncompressed:" |
260 | << uncompressed; | 261 | << uncompressed; |
261 | return uncompressed; | 262 | return uncompressed; |
262 | } | 263 | } |
263 | 264 | ||
@@ -281,7 +282,7 @@ QList<QuaZipFileInfo> ZipUtil::contentProperties() | |||
281 | { | 282 | { |
282 | QList<QuaZipFileInfo> items; | 283 | QList<QuaZipFileInfo> items; |
283 | if(!m_zip || !m_zip->isOpen()) { | 284 | if(!m_zip || !m_zip->isOpen()) { |
284 | qDebug() << "[ZipUtil] Zip file not open!"; | 285 | LOG_ERROR() << "Zip file not open!"; |
285 | return items; | 286 | return items; |
286 | } | 287 | } |
287 | QuaZipFileInfo info; | 288 | QuaZipFileInfo info; |
@@ -290,8 +291,8 @@ QList<QuaZipFileInfo> ZipUtil::contentProperties() | |||
290 | { | 291 | { |
291 | currentFile.getFileInfo(&info); | 292 | currentFile.getFileInfo(&info); |
292 | if(currentFile.getZipError() != UNZ_OK) { | 293 | if(currentFile.getZipError() != UNZ_OK) { |
293 | qDebug() << "[ZipUtil] QuaZip error:" << currentFile.getZipError() | 294 | LOG_ERROR() << "QuaZip error:" << currentFile.getZipError() |
294 | << "on file" << currentFile.getFileName(); | 295 | << "on file" << currentFile.getFileName(); |
295 | return QList<QuaZipFileInfo>(); | 296 | return QList<QuaZipFileInfo>(); |
296 | } | 297 | } |
297 | items.append(info); | 298 | items.append(info); |