1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Dominik Riebeling 2009-08-08 12:12:49 +00:00
parent c8e39403f4
commit bd5b744a6d
4 changed files with 37 additions and 27 deletions

View file

@ -74,7 +74,7 @@ bool Autodetection::detect()
{
// do the file checking
QDir dir(mounts.at(i));
qDebug() << "paths to check for player specific files:" << mounts;
qDebug() << "[Autodetect] paths to check:" << mounts;
if(dir.exists())
{
// check logfile first.
@ -85,7 +85,7 @@ bool Autodetection::detect()
if(m_device.isEmpty())
m_device = log.value("platform").toString();
m_mountpoint = mounts.at(i);
qDebug() << "rbutil.log detected:" << m_device << m_mountpoint;
qDebug() << "[Autodetect] rbutil.log detected:" << m_device << m_mountpoint;
return true;
}
}
@ -97,12 +97,13 @@ bool Autodetection::detect()
if(m_device.isEmpty())
{
m_device = info.target();
}
}
m_mountpoint = mounts.at(i);
qDebug() << "rockbox-info.txt detected:" << m_device << m_mountpoint;
qDebug() << "[Autodetect] rockbox-info.txt detected:"
<< m_device << m_mountpoint;
return true;
}
// check for some specific files in root folder
QDir root(mounts.at(i));
QStringList rootentries = root.entryList(QDir::Files);
@ -129,10 +130,10 @@ bool Autodetection::detect()
}
if(rootentries.contains("ajbrec.ajz", Qt::CaseInsensitive))
{
qDebug() << "ajbrec.ajz found. Trying detectAjbrec()";
qDebug() << "[Autodetect] ajbrec.ajz found. Trying detectAjbrec()";
if(detectAjbrec(mounts.at(i))) {
m_mountpoint = mounts.at(i);
qDebug() << m_device;
qDebug() << "[Autodetect]" << m_device;
return true;
}
}
@ -167,13 +168,13 @@ bool Autodetection::detect()
struct ipod_t ipod;
n = ipod_scan(&ipod);
if(n == 1) {
qDebug() << "Ipod found:" << ipod.modelstr << "at" << ipod.diskname;
qDebug() << "[Autodetect] Ipod found:" << ipod.modelstr << "at" << ipod.diskname;
m_device = ipod.targetname;
m_mountpoint = resolveMountPoint(ipod.diskname);
return true;
}
else {
qDebug() << "ipodpatcher: no Ipod found." << n;
qDebug() << "[Autodetect] ipodpatcher: no Ipod found." << n;
}
free(ipod_sectorbuf);
ipod_sectorbuf = NULL;
@ -185,13 +186,13 @@ bool Autodetection::detect()
struct sansa_t sansa;
n = sansa_scan(&sansa);
if(n == 1) {
qDebug() << "Sansa found:" << sansa.targetname << "at" << sansa.diskname;
qDebug() << "[Autodetect] Sansa found:" << sansa.targetname << "at" << sansa.diskname;
m_device = QString("sansa%1").arg(sansa.targetname);
m_mountpoint = resolveMountPoint(sansa.diskname);
return true;
}
else {
qDebug() << "sansapatcher: no Sansa found." << n;
qDebug() << "[Autodetect] sansapatcher: no Sansa found." << n;
}
free(sansa_sectorbuf);
sansa_sectorbuf = NULL;
@ -246,7 +247,7 @@ QStringList Autodetection::mountpoints()
*/
QString Autodetection::resolveMountPoint(QString device)
{
qDebug() << "Autodetection::resolveMountPoint(QString)" << device;
qDebug() << "[Autodetect] resolving mountpoint:" << device;
#if defined(Q_OS_LINUX)
FILE *mn = setmntent("/etc/mtab", "r");
@ -302,7 +303,7 @@ QString Autodetection::resolveMountPoint(QString device)
break;
}
}
qDebug() << "Autodetection::resolveMountPoint(QString)" << "->" << result;
qDebug() << "[Autodetect] resolved mountpoint is:" << result;
if(!result.isEmpty())
return result + ":/";
#endif
@ -316,7 +317,7 @@ QString Autodetection::resolveMountPoint(QString device)
*/
QString Autodetection::resolveDevicename(QString path)
{
qDebug() << __func__;
qDebug() << "[Autodetect] resolving device name" << path;
#if defined(Q_OS_LINUX)
FILE *mn = setmntent("/etc/mtab", "r");
if(!mn)
@ -377,7 +378,7 @@ QString Autodetection::resolveDevicename(QString path)
if(DeviceIoControl(h, IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS,
NULL, 0, extents, sizeof(buffer), &written, NULL)) {
if(extents->NumberOfDiskExtents > 1) {
qDebug() << "volume spans multiple disks!";
qDebug() << "[Autodetect] resolving device name: volume spans multiple disks!";
return "";
}
//qDebug() << "Disk:" << extents->Extents[0].DiskNumber;
@ -441,8 +442,8 @@ bool Autodetection::detectAjbrec(QString root)
// recorder v1 has the binary length in the first 4 bytes, so check
// for them first.
int len = (header[0]<<24) | (header[1]<<16) | (header[2]<<8) | header[3];
qDebug() << "possible bin length:" << len;
qDebug() << "file len:" << f.size();
qDebug() << "[Autodetect] ABJREC possible bin length:" << len
<< "file len:" << f.size();
if((f.size() - 6) == len)
m_device = "recorder";

View file

@ -198,9 +198,7 @@ QMap<uint32_t, QString> Detect::listUsbDevices(void)
b = usb_busses;
while(b) {
qDebug() << "bus:" << b->dirname << b->devices;
if(b->devices) {
qDebug() << "devices present.";
struct usb_device *u;
u = b->devices;
while(u) {
@ -214,12 +212,14 @@ QMap<uint32_t, QString> Detect::listUsbDevices(void)
dev = usb_open(u);
if(dev) {
if(u->descriptor.iManufacturer) {
res = usb_get_string_simple(dev, u->descriptor.iManufacturer, string, sizeof(string));
res = usb_get_string_simple(dev, u->descriptor.iManufacturer,
string, sizeof(string));
if(res > 0)
name += QString::fromAscii(string) + " ";
}
if(u->descriptor.iProduct) {
res = usb_get_string_simple(dev, u->descriptor.iProduct, string, sizeof(string));
res = usb_get_string_simple(dev, u->descriptor.iProduct,
string, sizeof(string));
if(res > 0)
name += QString::fromAscii(string);
}
@ -227,7 +227,10 @@ QMap<uint32_t, QString> Detect::listUsbDevices(void)
usb_close(dev);
if(name.isEmpty()) name = QObject::tr("(no description available)");
if(id) usbids.insert(id, name);
if(id) {
usbids.insert(id, name);
qDebug() << "[Detect] USB:" << QString("0x%1").arg(id, 8, 16) << name;
}
u = u->next;
}
}
@ -300,7 +303,7 @@ QMap<uint32_t, QString> Detect::listUsbDevices(void)
uint32_t id;
id = vid << 16 | pid;
usbids.insert(id, description);
qDebug("VID: %04x, PID: %04x", vid, pid);
qDebug("[Detect] USB VID: %04x, PID: %04x", vid, pid);
}
if(buffer) free(buffer);
}

View file

@ -90,6 +90,7 @@ Config::Config(QWidget *parent,int index) : QDialog(parent)
setDevices();
}
void Config::accept()
{
qDebug() << "[Config] checking configuration";
@ -115,7 +116,8 @@ void Config::accept()
RbSettings::setValue(RbSettings::ProxyType, proxyType);
// language
if(RbSettings::value(RbSettings::Language).toString() != language && !language.isEmpty()) {
if(RbSettings::value(RbSettings::Language).toString() != language
&& !language.isEmpty()) {
QMessageBox::information(this, tr("Language changed"),
tr("You need to restart the application for the changed language to take effect."));
RbSettings::setValue(RbSettings::Language, language);
@ -196,6 +198,7 @@ void Config::abort()
this->close();
}
void Config::setUserSettings()
{
// set proxy
@ -391,6 +394,7 @@ void Config::updateEncState()
}
}
void Config::setNoProxy(bool checked)
{
bool i = !checked;
@ -519,6 +523,7 @@ void Config::browseCache()
}
void Config::setMountpoint(QString m)
{
ui.mountPoint->setText(m);
@ -623,6 +628,7 @@ void Config::autodetect()
ui.treeDevices->setEnabled(true);
}
void Config::cacheClear()
{
if(QMessageBox::critical(this, tr("Really delete cache?"),

View file

@ -31,7 +31,7 @@ class Config : public QDialog
Q_OBJECT
public:
Config(QWidget *parent = 0,int index=0);
signals:
void settingsUpdated(void);
@ -42,9 +42,9 @@ class Config : public QDialog
private:
void setUserSettings();
void setDevices();
Ui::ConfigForm ui;
QStringList findLanguageFiles(void);
QString languageName(const QString&);
QMap<QString, QString> lang;