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:
parent
c8e39403f4
commit
bd5b744a6d
4 changed files with 37 additions and 27 deletions
|
@ -74,7 +74,7 @@ bool Autodetection::detect()
|
||||||
{
|
{
|
||||||
// do the file checking
|
// do the file checking
|
||||||
QDir dir(mounts.at(i));
|
QDir dir(mounts.at(i));
|
||||||
qDebug() << "paths to check for player specific files:" << mounts;
|
qDebug() << "[Autodetect] paths to check:" << mounts;
|
||||||
if(dir.exists())
|
if(dir.exists())
|
||||||
{
|
{
|
||||||
// check logfile first.
|
// check logfile first.
|
||||||
|
@ -85,7 +85,7 @@ bool Autodetection::detect()
|
||||||
if(m_device.isEmpty())
|
if(m_device.isEmpty())
|
||||||
m_device = log.value("platform").toString();
|
m_device = log.value("platform").toString();
|
||||||
m_mountpoint = mounts.at(i);
|
m_mountpoint = mounts.at(i);
|
||||||
qDebug() << "rbutil.log detected:" << m_device << m_mountpoint;
|
qDebug() << "[Autodetect] rbutil.log detected:" << m_device << m_mountpoint;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -97,12 +97,13 @@ bool Autodetection::detect()
|
||||||
if(m_device.isEmpty())
|
if(m_device.isEmpty())
|
||||||
{
|
{
|
||||||
m_device = info.target();
|
m_device = info.target();
|
||||||
}
|
}
|
||||||
m_mountpoint = mounts.at(i);
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for some specific files in root folder
|
// check for some specific files in root folder
|
||||||
QDir root(mounts.at(i));
|
QDir root(mounts.at(i));
|
||||||
QStringList rootentries = root.entryList(QDir::Files);
|
QStringList rootentries = root.entryList(QDir::Files);
|
||||||
|
@ -129,10 +130,10 @@ bool Autodetection::detect()
|
||||||
}
|
}
|
||||||
if(rootentries.contains("ajbrec.ajz", Qt::CaseInsensitive))
|
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))) {
|
if(detectAjbrec(mounts.at(i))) {
|
||||||
m_mountpoint = mounts.at(i);
|
m_mountpoint = mounts.at(i);
|
||||||
qDebug() << m_device;
|
qDebug() << "[Autodetect]" << m_device;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -167,13 +168,13 @@ bool Autodetection::detect()
|
||||||
struct ipod_t ipod;
|
struct ipod_t ipod;
|
||||||
n = ipod_scan(&ipod);
|
n = ipod_scan(&ipod);
|
||||||
if(n == 1) {
|
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_device = ipod.targetname;
|
||||||
m_mountpoint = resolveMountPoint(ipod.diskname);
|
m_mountpoint = resolveMountPoint(ipod.diskname);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
qDebug() << "ipodpatcher: no Ipod found." << n;
|
qDebug() << "[Autodetect] ipodpatcher: no Ipod found." << n;
|
||||||
}
|
}
|
||||||
free(ipod_sectorbuf);
|
free(ipod_sectorbuf);
|
||||||
ipod_sectorbuf = NULL;
|
ipod_sectorbuf = NULL;
|
||||||
|
@ -185,13 +186,13 @@ bool Autodetection::detect()
|
||||||
struct sansa_t sansa;
|
struct sansa_t sansa;
|
||||||
n = sansa_scan(&sansa);
|
n = sansa_scan(&sansa);
|
||||||
if(n == 1) {
|
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_device = QString("sansa%1").arg(sansa.targetname);
|
||||||
m_mountpoint = resolveMountPoint(sansa.diskname);
|
m_mountpoint = resolveMountPoint(sansa.diskname);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
qDebug() << "sansapatcher: no Sansa found." << n;
|
qDebug() << "[Autodetect] sansapatcher: no Sansa found." << n;
|
||||||
}
|
}
|
||||||
free(sansa_sectorbuf);
|
free(sansa_sectorbuf);
|
||||||
sansa_sectorbuf = NULL;
|
sansa_sectorbuf = NULL;
|
||||||
|
@ -246,7 +247,7 @@ QStringList Autodetection::mountpoints()
|
||||||
*/
|
*/
|
||||||
QString Autodetection::resolveMountPoint(QString device)
|
QString Autodetection::resolveMountPoint(QString device)
|
||||||
{
|
{
|
||||||
qDebug() << "Autodetection::resolveMountPoint(QString)" << device;
|
qDebug() << "[Autodetect] resolving mountpoint:" << device;
|
||||||
|
|
||||||
#if defined(Q_OS_LINUX)
|
#if defined(Q_OS_LINUX)
|
||||||
FILE *mn = setmntent("/etc/mtab", "r");
|
FILE *mn = setmntent("/etc/mtab", "r");
|
||||||
|
@ -302,7 +303,7 @@ QString Autodetection::resolveMountPoint(QString device)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
qDebug() << "Autodetection::resolveMountPoint(QString)" << "->" << result;
|
qDebug() << "[Autodetect] resolved mountpoint is:" << result;
|
||||||
if(!result.isEmpty())
|
if(!result.isEmpty())
|
||||||
return result + ":/";
|
return result + ":/";
|
||||||
#endif
|
#endif
|
||||||
|
@ -316,7 +317,7 @@ QString Autodetection::resolveMountPoint(QString device)
|
||||||
*/
|
*/
|
||||||
QString Autodetection::resolveDevicename(QString path)
|
QString Autodetection::resolveDevicename(QString path)
|
||||||
{
|
{
|
||||||
qDebug() << __func__;
|
qDebug() << "[Autodetect] resolving device name" << path;
|
||||||
#if defined(Q_OS_LINUX)
|
#if defined(Q_OS_LINUX)
|
||||||
FILE *mn = setmntent("/etc/mtab", "r");
|
FILE *mn = setmntent("/etc/mtab", "r");
|
||||||
if(!mn)
|
if(!mn)
|
||||||
|
@ -377,7 +378,7 @@ QString Autodetection::resolveDevicename(QString path)
|
||||||
if(DeviceIoControl(h, IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS,
|
if(DeviceIoControl(h, IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS,
|
||||||
NULL, 0, extents, sizeof(buffer), &written, NULL)) {
|
NULL, 0, extents, sizeof(buffer), &written, NULL)) {
|
||||||
if(extents->NumberOfDiskExtents > 1) {
|
if(extents->NumberOfDiskExtents > 1) {
|
||||||
qDebug() << "volume spans multiple disks!";
|
qDebug() << "[Autodetect] resolving device name: volume spans multiple disks!";
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
//qDebug() << "Disk:" << extents->Extents[0].DiskNumber;
|
//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
|
// recorder v1 has the binary length in the first 4 bytes, so check
|
||||||
// for them first.
|
// for them first.
|
||||||
int len = (header[0]<<24) | (header[1]<<16) | (header[2]<<8) | header[3];
|
int len = (header[0]<<24) | (header[1]<<16) | (header[2]<<8) | header[3];
|
||||||
qDebug() << "possible bin length:" << len;
|
qDebug() << "[Autodetect] ABJREC possible bin length:" << len
|
||||||
qDebug() << "file len:" << f.size();
|
<< "file len:" << f.size();
|
||||||
if((f.size() - 6) == len)
|
if((f.size() - 6) == len)
|
||||||
m_device = "recorder";
|
m_device = "recorder";
|
||||||
|
|
||||||
|
|
|
@ -198,9 +198,7 @@ QMap<uint32_t, QString> Detect::listUsbDevices(void)
|
||||||
b = usb_busses;
|
b = usb_busses;
|
||||||
|
|
||||||
while(b) {
|
while(b) {
|
||||||
qDebug() << "bus:" << b->dirname << b->devices;
|
|
||||||
if(b->devices) {
|
if(b->devices) {
|
||||||
qDebug() << "devices present.";
|
|
||||||
struct usb_device *u;
|
struct usb_device *u;
|
||||||
u = b->devices;
|
u = b->devices;
|
||||||
while(u) {
|
while(u) {
|
||||||
|
@ -214,12 +212,14 @@ QMap<uint32_t, QString> Detect::listUsbDevices(void)
|
||||||
dev = usb_open(u);
|
dev = usb_open(u);
|
||||||
if(dev) {
|
if(dev) {
|
||||||
if(u->descriptor.iManufacturer) {
|
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)
|
if(res > 0)
|
||||||
name += QString::fromAscii(string) + " ";
|
name += QString::fromAscii(string) + " ";
|
||||||
}
|
}
|
||||||
if(u->descriptor.iProduct) {
|
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)
|
if(res > 0)
|
||||||
name += QString::fromAscii(string);
|
name += QString::fromAscii(string);
|
||||||
}
|
}
|
||||||
|
@ -227,7 +227,10 @@ QMap<uint32_t, QString> Detect::listUsbDevices(void)
|
||||||
usb_close(dev);
|
usb_close(dev);
|
||||||
if(name.isEmpty()) name = QObject::tr("(no description available)");
|
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;
|
u = u->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -300,7 +303,7 @@ QMap<uint32_t, QString> Detect::listUsbDevices(void)
|
||||||
uint32_t id;
|
uint32_t id;
|
||||||
id = vid << 16 | pid;
|
id = vid << 16 | pid;
|
||||||
usbids.insert(id, description);
|
usbids.insert(id, description);
|
||||||
qDebug("VID: %04x, PID: %04x", vid, pid);
|
qDebug("[Detect] USB VID: %04x, PID: %04x", vid, pid);
|
||||||
}
|
}
|
||||||
if(buffer) free(buffer);
|
if(buffer) free(buffer);
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,6 +90,7 @@ Config::Config(QWidget *parent,int index) : QDialog(parent)
|
||||||
setDevices();
|
setDevices();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Config::accept()
|
void Config::accept()
|
||||||
{
|
{
|
||||||
qDebug() << "[Config] checking configuration";
|
qDebug() << "[Config] checking configuration";
|
||||||
|
@ -115,7 +116,8 @@ void Config::accept()
|
||||||
RbSettings::setValue(RbSettings::ProxyType, proxyType);
|
RbSettings::setValue(RbSettings::ProxyType, proxyType);
|
||||||
|
|
||||||
// language
|
// 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"),
|
QMessageBox::information(this, tr("Language changed"),
|
||||||
tr("You need to restart the application for the changed language to take effect."));
|
tr("You need to restart the application for the changed language to take effect."));
|
||||||
RbSettings::setValue(RbSettings::Language, language);
|
RbSettings::setValue(RbSettings::Language, language);
|
||||||
|
@ -196,6 +198,7 @@ void Config::abort()
|
||||||
this->close();
|
this->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Config::setUserSettings()
|
void Config::setUserSettings()
|
||||||
{
|
{
|
||||||
// set proxy
|
// set proxy
|
||||||
|
@ -391,6 +394,7 @@ void Config::updateEncState()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Config::setNoProxy(bool checked)
|
void Config::setNoProxy(bool checked)
|
||||||
{
|
{
|
||||||
bool i = !checked;
|
bool i = !checked;
|
||||||
|
@ -519,6 +523,7 @@ void Config::browseCache()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Config::setMountpoint(QString m)
|
void Config::setMountpoint(QString m)
|
||||||
{
|
{
|
||||||
ui.mountPoint->setText(m);
|
ui.mountPoint->setText(m);
|
||||||
|
@ -623,6 +628,7 @@ void Config::autodetect()
|
||||||
ui.treeDevices->setEnabled(true);
|
ui.treeDevices->setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Config::cacheClear()
|
void Config::cacheClear()
|
||||||
{
|
{
|
||||||
if(QMessageBox::critical(this, tr("Really delete cache?"),
|
if(QMessageBox::critical(this, tr("Really delete cache?"),
|
||||||
|
|
|
@ -31,7 +31,7 @@ class Config : public QDialog
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
Config(QWidget *parent = 0,int index=0);
|
Config(QWidget *parent = 0,int index=0);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void settingsUpdated(void);
|
void settingsUpdated(void);
|
||||||
|
|
||||||
|
@ -42,9 +42,9 @@ class Config : public QDialog
|
||||||
private:
|
private:
|
||||||
void setUserSettings();
|
void setUserSettings();
|
||||||
void setDevices();
|
void setDevices();
|
||||||
|
|
||||||
Ui::ConfigForm ui;
|
Ui::ConfigForm ui;
|
||||||
|
|
||||||
QStringList findLanguageFiles(void);
|
QStringList findLanguageFiles(void);
|
||||||
QString languageName(const QString&);
|
QString languageName(const QString&);
|
||||||
QMap<QString, QString> lang;
|
QMap<QString, QString> lang;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue