diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2009-08-08 12:12:49 +0000 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2009-08-08 12:12:49 +0000 |
commit | bd5b744a6daa17f99a528bd62fdc45203d17233e (patch) | |
tree | b9754a63b5033093a975c12d0b353d54a9a33c38 | |
parent | c8e39403f414814d07129f9c7dc0f0c04edbf45f (diff) | |
download | rockbox-bd5b744a6daa17f99a528bd62fdc45203d17233e.tar.gz rockbox-bd5b744a6daa17f99a528bd62fdc45203d17233e.zip |
Clean up some debug output, kill some trailing spaces and break some overly long lines.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22204 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | rbutil/rbutilqt/base/autodetection.cpp | 35 | ||||
-rw-r--r-- | rbutil/rbutilqt/base/detect.cpp | 15 | ||||
-rw-r--r-- | rbutil/rbutilqt/configure.cpp | 8 | ||||
-rw-r--r-- | rbutil/rbutilqt/configure.h | 6 |
4 files changed, 37 insertions, 27 deletions
diff --git a/rbutil/rbutilqt/base/autodetection.cpp b/rbutil/rbutilqt/base/autodetection.cpp index 30651077f2..386b39057a 100644 --- a/rbutil/rbutilqt/base/autodetection.cpp +++ b/rbutil/rbutilqt/base/autodetection.cpp | |||
@@ -74,7 +74,7 @@ bool Autodetection::detect() | |||
74 | { | 74 | { |
75 | // do the file checking | 75 | // do the file checking |
76 | QDir dir(mounts.at(i)); | 76 | QDir dir(mounts.at(i)); |
77 | qDebug() << "paths to check for player specific files:" << mounts; | 77 | qDebug() << "[Autodetect] paths to check:" << mounts; |
78 | if(dir.exists()) | 78 | if(dir.exists()) |
79 | { | 79 | { |
80 | // check logfile first. | 80 | // check logfile first. |
@@ -85,7 +85,7 @@ bool Autodetection::detect() | |||
85 | if(m_device.isEmpty()) | 85 | if(m_device.isEmpty()) |
86 | m_device = log.value("platform").toString(); | 86 | m_device = log.value("platform").toString(); |
87 | m_mountpoint = mounts.at(i); | 87 | m_mountpoint = mounts.at(i); |
88 | qDebug() << "rbutil.log detected:" << m_device << m_mountpoint; | 88 | qDebug() << "[Autodetect] rbutil.log detected:" << m_device << m_mountpoint; |
89 | return true; | 89 | return true; |
90 | } | 90 | } |
91 | } | 91 | } |
@@ -97,12 +97,13 @@ bool Autodetection::detect() | |||
97 | if(m_device.isEmpty()) | 97 | if(m_device.isEmpty()) |
98 | { | 98 | { |
99 | m_device = info.target(); | 99 | m_device = info.target(); |
100 | } | 100 | } |
101 | m_mountpoint = mounts.at(i); | 101 | m_mountpoint = mounts.at(i); |
102 | qDebug() << "rockbox-info.txt detected:" << m_device << m_mountpoint; | 102 | qDebug() << "[Autodetect] rockbox-info.txt detected:" |
103 | << m_device << m_mountpoint; | ||
103 | return true; | 104 | return true; |
104 | } | 105 | } |
105 | 106 | ||
106 | // check for some specific files in root folder | 107 | // check for some specific files in root folder |
107 | QDir root(mounts.at(i)); | 108 | QDir root(mounts.at(i)); |
108 | QStringList rootentries = root.entryList(QDir::Files); | 109 | QStringList rootentries = root.entryList(QDir::Files); |
@@ -129,10 +130,10 @@ bool Autodetection::detect() | |||
129 | } | 130 | } |
130 | if(rootentries.contains("ajbrec.ajz", Qt::CaseInsensitive)) | 131 | if(rootentries.contains("ajbrec.ajz", Qt::CaseInsensitive)) |
131 | { | 132 | { |
132 | qDebug() << "ajbrec.ajz found. Trying detectAjbrec()"; | 133 | qDebug() << "[Autodetect] ajbrec.ajz found. Trying detectAjbrec()"; |
133 | if(detectAjbrec(mounts.at(i))) { | 134 | if(detectAjbrec(mounts.at(i))) { |
134 | m_mountpoint = mounts.at(i); | 135 | m_mountpoint = mounts.at(i); |
135 | qDebug() << m_device; | 136 | qDebug() << "[Autodetect]" << m_device; |
136 | return true; | 137 | return true; |
137 | } | 138 | } |
138 | } | 139 | } |
@@ -167,13 +168,13 @@ bool Autodetection::detect() | |||
167 | struct ipod_t ipod; | 168 | struct ipod_t ipod; |
168 | n = ipod_scan(&ipod); | 169 | n = ipod_scan(&ipod); |
169 | if(n == 1) { | 170 | if(n == 1) { |
170 | qDebug() << "Ipod found:" << ipod.modelstr << "at" << ipod.diskname; | 171 | qDebug() << "[Autodetect] Ipod found:" << ipod.modelstr << "at" << ipod.diskname; |
171 | m_device = ipod.targetname; | 172 | m_device = ipod.targetname; |
172 | m_mountpoint = resolveMountPoint(ipod.diskname); | 173 | m_mountpoint = resolveMountPoint(ipod.diskname); |
173 | return true; | 174 | return true; |
174 | } | 175 | } |
175 | else { | 176 | else { |
176 | qDebug() << "ipodpatcher: no Ipod found." << n; | 177 | qDebug() << "[Autodetect] ipodpatcher: no Ipod found." << n; |
177 | } | 178 | } |
178 | free(ipod_sectorbuf); | 179 | free(ipod_sectorbuf); |
179 | ipod_sectorbuf = NULL; | 180 | ipod_sectorbuf = NULL; |
@@ -185,13 +186,13 @@ bool Autodetection::detect() | |||
185 | struct sansa_t sansa; | 186 | struct sansa_t sansa; |
186 | n = sansa_scan(&sansa); | 187 | n = sansa_scan(&sansa); |
187 | if(n == 1) { | 188 | if(n == 1) { |
188 | qDebug() << "Sansa found:" << sansa.targetname << "at" << sansa.diskname; | 189 | qDebug() << "[Autodetect] Sansa found:" << sansa.targetname << "at" << sansa.diskname; |
189 | m_device = QString("sansa%1").arg(sansa.targetname); | 190 | m_device = QString("sansa%1").arg(sansa.targetname); |
190 | m_mountpoint = resolveMountPoint(sansa.diskname); | 191 | m_mountpoint = resolveMountPoint(sansa.diskname); |
191 | return true; | 192 | return true; |
192 | } | 193 | } |
193 | else { | 194 | else { |
194 | qDebug() << "sansapatcher: no Sansa found." << n; | 195 | qDebug() << "[Autodetect] sansapatcher: no Sansa found." << n; |
195 | } | 196 | } |
196 | free(sansa_sectorbuf); | 197 | free(sansa_sectorbuf); |
197 | sansa_sectorbuf = NULL; | 198 | sansa_sectorbuf = NULL; |
@@ -246,7 +247,7 @@ QStringList Autodetection::mountpoints() | |||
246 | */ | 247 | */ |
247 | QString Autodetection::resolveMountPoint(QString device) | 248 | QString Autodetection::resolveMountPoint(QString device) |
248 | { | 249 | { |
249 | qDebug() << "Autodetection::resolveMountPoint(QString)" << device; | 250 | qDebug() << "[Autodetect] resolving mountpoint:" << device; |
250 | 251 | ||
251 | #if defined(Q_OS_LINUX) | 252 | #if defined(Q_OS_LINUX) |
252 | FILE *mn = setmntent("/etc/mtab", "r"); | 253 | FILE *mn = setmntent("/etc/mtab", "r"); |
@@ -302,7 +303,7 @@ QString Autodetection::resolveMountPoint(QString device) | |||
302 | break; | 303 | break; |
303 | } | 304 | } |
304 | } | 305 | } |
305 | qDebug() << "Autodetection::resolveMountPoint(QString)" << "->" << result; | 306 | qDebug() << "[Autodetect] resolved mountpoint is:" << result; |
306 | if(!result.isEmpty()) | 307 | if(!result.isEmpty()) |
307 | return result + ":/"; | 308 | return result + ":/"; |
308 | #endif | 309 | #endif |
@@ -316,7 +317,7 @@ QString Autodetection::resolveMountPoint(QString device) | |||
316 | */ | 317 | */ |
317 | QString Autodetection::resolveDevicename(QString path) | 318 | QString Autodetection::resolveDevicename(QString path) |
318 | { | 319 | { |
319 | qDebug() << __func__; | 320 | qDebug() << "[Autodetect] resolving device name" << path; |
320 | #if defined(Q_OS_LINUX) | 321 | #if defined(Q_OS_LINUX) |
321 | FILE *mn = setmntent("/etc/mtab", "r"); | 322 | FILE *mn = setmntent("/etc/mtab", "r"); |
322 | if(!mn) | 323 | if(!mn) |
@@ -377,7 +378,7 @@ QString Autodetection::resolveDevicename(QString path) | |||
377 | if(DeviceIoControl(h, IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS, | 378 | if(DeviceIoControl(h, IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS, |
378 | NULL, 0, extents, sizeof(buffer), &written, NULL)) { | 379 | NULL, 0, extents, sizeof(buffer), &written, NULL)) { |
379 | if(extents->NumberOfDiskExtents > 1) { | 380 | if(extents->NumberOfDiskExtents > 1) { |
380 | qDebug() << "volume spans multiple disks!"; | 381 | qDebug() << "[Autodetect] resolving device name: volume spans multiple disks!"; |
381 | return ""; | 382 | return ""; |
382 | } | 383 | } |
383 | //qDebug() << "Disk:" << extents->Extents[0].DiskNumber; | 384 | //qDebug() << "Disk:" << extents->Extents[0].DiskNumber; |
@@ -441,8 +442,8 @@ bool Autodetection::detectAjbrec(QString root) | |||
441 | // recorder v1 has the binary length in the first 4 bytes, so check | 442 | // recorder v1 has the binary length in the first 4 bytes, so check |
442 | // for them first. | 443 | // for them first. |
443 | int len = (header[0]<<24) | (header[1]<<16) | (header[2]<<8) | header[3]; | 444 | int len = (header[0]<<24) | (header[1]<<16) | (header[2]<<8) | header[3]; |
444 | qDebug() << "possible bin length:" << len; | 445 | qDebug() << "[Autodetect] ABJREC possible bin length:" << len |
445 | qDebug() << "file len:" << f.size(); | 446 | << "file len:" << f.size(); |
446 | if((f.size() - 6) == len) | 447 | if((f.size() - 6) == len) |
447 | m_device = "recorder"; | 448 | m_device = "recorder"; |
448 | 449 | ||
diff --git a/rbutil/rbutilqt/base/detect.cpp b/rbutil/rbutilqt/base/detect.cpp index 70f2de6f41..d471c98273 100644 --- a/rbutil/rbutilqt/base/detect.cpp +++ b/rbutil/rbutilqt/base/detect.cpp | |||
@@ -198,9 +198,7 @@ QMap<uint32_t, QString> Detect::listUsbDevices(void) | |||
198 | b = usb_busses; | 198 | b = usb_busses; |
199 | 199 | ||
200 | while(b) { | 200 | while(b) { |
201 | qDebug() << "bus:" << b->dirname << b->devices; | ||
202 | if(b->devices) { | 201 | if(b->devices) { |
203 | qDebug() << "devices present."; | ||
204 | struct usb_device *u; | 202 | struct usb_device *u; |
205 | u = b->devices; | 203 | u = b->devices; |
206 | while(u) { | 204 | while(u) { |
@@ -214,12 +212,14 @@ QMap<uint32_t, QString> Detect::listUsbDevices(void) | |||
214 | dev = usb_open(u); | 212 | dev = usb_open(u); |
215 | if(dev) { | 213 | if(dev) { |
216 | if(u->descriptor.iManufacturer) { | 214 | if(u->descriptor.iManufacturer) { |
217 | res = usb_get_string_simple(dev, u->descriptor.iManufacturer, string, sizeof(string)); | 215 | res = usb_get_string_simple(dev, u->descriptor.iManufacturer, |
216 | string, sizeof(string)); | ||
218 | if(res > 0) | 217 | if(res > 0) |
219 | name += QString::fromAscii(string) + " "; | 218 | name += QString::fromAscii(string) + " "; |
220 | } | 219 | } |
221 | if(u->descriptor.iProduct) { | 220 | if(u->descriptor.iProduct) { |
222 | res = usb_get_string_simple(dev, u->descriptor.iProduct, string, sizeof(string)); | 221 | res = usb_get_string_simple(dev, u->descriptor.iProduct, |
222 | string, sizeof(string)); | ||
223 | if(res > 0) | 223 | if(res > 0) |
224 | name += QString::fromAscii(string); | 224 | name += QString::fromAscii(string); |
225 | } | 225 | } |
@@ -227,7 +227,10 @@ QMap<uint32_t, QString> Detect::listUsbDevices(void) | |||
227 | usb_close(dev); | 227 | usb_close(dev); |
228 | if(name.isEmpty()) name = QObject::tr("(no description available)"); | 228 | if(name.isEmpty()) name = QObject::tr("(no description available)"); |
229 | 229 | ||
230 | if(id) usbids.insert(id, name); | 230 | if(id) { |
231 | usbids.insert(id, name); | ||
232 | qDebug() << "[Detect] USB:" << QString("0x%1").arg(id, 8, 16) << name; | ||
233 | } | ||
231 | u = u->next; | 234 | u = u->next; |
232 | } | 235 | } |
233 | } | 236 | } |
@@ -300,7 +303,7 @@ QMap<uint32_t, QString> Detect::listUsbDevices(void) | |||
300 | uint32_t id; | 303 | uint32_t id; |
301 | id = vid << 16 | pid; | 304 | id = vid << 16 | pid; |
302 | usbids.insert(id, description); | 305 | usbids.insert(id, description); |
303 | qDebug("VID: %04x, PID: %04x", vid, pid); | 306 | qDebug("[Detect] USB VID: %04x, PID: %04x", vid, pid); |
304 | } | 307 | } |
305 | if(buffer) free(buffer); | 308 | if(buffer) free(buffer); |
306 | } | 309 | } |
diff --git a/rbutil/rbutilqt/configure.cpp b/rbutil/rbutilqt/configure.cpp index b4c71cf32a..e32cccb00f 100644 --- a/rbutil/rbutilqt/configure.cpp +++ b/rbutil/rbutilqt/configure.cpp | |||
@@ -90,6 +90,7 @@ Config::Config(QWidget *parent,int index) : QDialog(parent) | |||
90 | setDevices(); | 90 | setDevices(); |
91 | } | 91 | } |
92 | 92 | ||
93 | |||
93 | void Config::accept() | 94 | void Config::accept() |
94 | { | 95 | { |
95 | qDebug() << "[Config] checking configuration"; | 96 | qDebug() << "[Config] checking configuration"; |
@@ -115,7 +116,8 @@ void Config::accept() | |||
115 | RbSettings::setValue(RbSettings::ProxyType, proxyType); | 116 | RbSettings::setValue(RbSettings::ProxyType, proxyType); |
116 | 117 | ||
117 | // language | 118 | // language |
118 | if(RbSettings::value(RbSettings::Language).toString() != language && !language.isEmpty()) { | 119 | if(RbSettings::value(RbSettings::Language).toString() != language |
120 | && !language.isEmpty()) { | ||
119 | QMessageBox::information(this, tr("Language changed"), | 121 | QMessageBox::information(this, tr("Language changed"), |
120 | tr("You need to restart the application for the changed language to take effect.")); | 122 | tr("You need to restart the application for the changed language to take effect.")); |
121 | RbSettings::setValue(RbSettings::Language, language); | 123 | RbSettings::setValue(RbSettings::Language, language); |
@@ -196,6 +198,7 @@ void Config::abort() | |||
196 | this->close(); | 198 | this->close(); |
197 | } | 199 | } |
198 | 200 | ||
201 | |||
199 | void Config::setUserSettings() | 202 | void Config::setUserSettings() |
200 | { | 203 | { |
201 | // set proxy | 204 | // set proxy |
@@ -391,6 +394,7 @@ void Config::updateEncState() | |||
391 | } | 394 | } |
392 | } | 395 | } |
393 | 396 | ||
397 | |||
394 | void Config::setNoProxy(bool checked) | 398 | void Config::setNoProxy(bool checked) |
395 | { | 399 | { |
396 | bool i = !checked; | 400 | bool i = !checked; |
@@ -519,6 +523,7 @@ void Config::browseCache() | |||
519 | 523 | ||
520 | } | 524 | } |
521 | 525 | ||
526 | |||
522 | void Config::setMountpoint(QString m) | 527 | void Config::setMountpoint(QString m) |
523 | { | 528 | { |
524 | ui.mountPoint->setText(m); | 529 | ui.mountPoint->setText(m); |
@@ -623,6 +628,7 @@ void Config::autodetect() | |||
623 | ui.treeDevices->setEnabled(true); | 628 | ui.treeDevices->setEnabled(true); |
624 | } | 629 | } |
625 | 630 | ||
631 | |||
626 | void Config::cacheClear() | 632 | void Config::cacheClear() |
627 | { | 633 | { |
628 | if(QMessageBox::critical(this, tr("Really delete cache?"), | 634 | if(QMessageBox::critical(this, tr("Really delete cache?"), |
diff --git a/rbutil/rbutilqt/configure.h b/rbutil/rbutilqt/configure.h index 6ae92b5b04..2ca54af5f5 100644 --- a/rbutil/rbutilqt/configure.h +++ b/rbutil/rbutilqt/configure.h | |||
@@ -31,7 +31,7 @@ class Config : public QDialog | |||
31 | Q_OBJECT | 31 | Q_OBJECT |
32 | public: | 32 | public: |
33 | Config(QWidget *parent = 0,int index=0); | 33 | Config(QWidget *parent = 0,int index=0); |
34 | 34 | ||
35 | signals: | 35 | signals: |
36 | void settingsUpdated(void); | 36 | void settingsUpdated(void); |
37 | 37 | ||
@@ -42,9 +42,9 @@ class Config : public QDialog | |||
42 | private: | 42 | private: |
43 | void setUserSettings(); | 43 | void setUserSettings(); |
44 | void setDevices(); | 44 | void setDevices(); |
45 | 45 | ||
46 | Ui::ConfigForm ui; | 46 | Ui::ConfigForm ui; |
47 | 47 | ||
48 | QStringList findLanguageFiles(void); | 48 | QStringList findLanguageFiles(void); |
49 | QString languageName(const QString&); | 49 | QString languageName(const QString&); |
50 | QMap<QString, QString> lang; | 50 | QMap<QString, QString> lang; |