forked from len0rd/rockbox
Rename getMountpoints() to mountpoints() to be in line with general (and Qt) naming -- get functions don't get a get prefix. Make the function static.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19426 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
e7022761b9
commit
fc7ba8806b
2 changed files with 19 additions and 19 deletions
|
|
@ -67,30 +67,30 @@ bool Autodetection::detect()
|
||||||
detectUsb();
|
detectUsb();
|
||||||
|
|
||||||
// Try detection via rockbox.info / rbutil.log
|
// Try detection via rockbox.info / rbutil.log
|
||||||
QStringList mountpoints = getMountpoints();
|
QStringList mounts = mountpoints();
|
||||||
|
|
||||||
for(int i=0; i< mountpoints.size();i++)
|
for(int i=0; i< mounts.size();i++)
|
||||||
{
|
{
|
||||||
// do the file checking
|
// do the file checking
|
||||||
QDir dir(mountpoints.at(i));
|
QDir dir(mounts.at(i));
|
||||||
qDebug() << "paths to check for player specific files:" << mountpoints;
|
qDebug() << "paths to check for player specific files:" << mounts;
|
||||||
if(dir.exists())
|
if(dir.exists())
|
||||||
{
|
{
|
||||||
// check logfile first.
|
// check logfile first.
|
||||||
if(QFile(mountpoints.at(i) + "/.rockbox/rbutil.log").exists()) {
|
if(QFile(mounts.at(i) + "/.rockbox/rbutil.log").exists()) {
|
||||||
QSettings log(mountpoints.at(i) + "/.rockbox/rbutil.log",
|
QSettings log(mounts.at(i) + "/.rockbox/rbutil.log",
|
||||||
QSettings::IniFormat, this);
|
QSettings::IniFormat, this);
|
||||||
if(!log.value("platform").toString().isEmpty()) {
|
if(!log.value("platform").toString().isEmpty()) {
|
||||||
if(m_device.isEmpty())
|
if(m_device.isEmpty())
|
||||||
m_device = log.value("platform").toString();
|
m_device = log.value("platform").toString();
|
||||||
m_mountpoint = mountpoints.at(i);
|
m_mountpoint = mounts.at(i);
|
||||||
qDebug() << "rbutil.log detected:" << m_device << m_mountpoint;
|
qDebug() << "rbutil.log detected:" << m_device << m_mountpoint;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// check rockbox-info.txt afterwards.
|
// check rockbox-info.txt afterwards.
|
||||||
QFile file(mountpoints.at(i) + "/.rockbox/rockbox-info.txt");
|
QFile file(mounts.at(i) + "/.rockbox/rockbox-info.txt");
|
||||||
if(file.exists())
|
if(file.exists())
|
||||||
{
|
{
|
||||||
file.open(QIODevice::ReadOnly | QIODevice::Text);
|
file.open(QIODevice::ReadOnly | QIODevice::Text);
|
||||||
|
|
@ -100,40 +100,40 @@ bool Autodetection::detect()
|
||||||
line.remove("Target: ");
|
line.remove("Target: ");
|
||||||
if(m_device.isEmpty())
|
if(m_device.isEmpty())
|
||||||
m_device = line.trimmed(); // trim whitespaces
|
m_device = line.trimmed(); // trim whitespaces
|
||||||
m_mountpoint = mountpoints.at(i);
|
m_mountpoint = mounts.at(i);
|
||||||
qDebug() << "rockbox-info.txt detected:" << m_device << m_mountpoint;
|
qDebug() << "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(mountpoints.at(i));
|
QDir root(mounts.at(i));
|
||||||
QStringList rootentries = root.entryList(QDir::Files);
|
QStringList rootentries = root.entryList(QDir::Files);
|
||||||
if(rootentries.contains("archos.mod", Qt::CaseInsensitive))
|
if(rootentries.contains("archos.mod", Qt::CaseInsensitive))
|
||||||
{
|
{
|
||||||
// archos.mod in root folder -> Archos Player
|
// archos.mod in root folder -> Archos Player
|
||||||
m_device = "player";
|
m_device = "player";
|
||||||
m_mountpoint = mountpoints.at(i);
|
m_mountpoint = mounts.at(i);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if(rootentries.contains("ONDIOST.BIN", Qt::CaseInsensitive))
|
if(rootentries.contains("ONDIOST.BIN", Qt::CaseInsensitive))
|
||||||
{
|
{
|
||||||
// ONDIOST.BIN in root -> Ondio FM
|
// ONDIOST.BIN in root -> Ondio FM
|
||||||
m_device = "ondiofm";
|
m_device = "ondiofm";
|
||||||
m_mountpoint = mountpoints.at(i);
|
m_mountpoint = mounts.at(i);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if(rootentries.contains("ONDIOSP.BIN", Qt::CaseInsensitive))
|
if(rootentries.contains("ONDIOSP.BIN", Qt::CaseInsensitive))
|
||||||
{
|
{
|
||||||
// ONDIOSP.BIN in root -> Ondio SP
|
// ONDIOSP.BIN in root -> Ondio SP
|
||||||
m_device = "ondiosp";
|
m_device = "ondiosp";
|
||||||
m_mountpoint = mountpoints.at(i);
|
m_mountpoint = mounts.at(i);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if(rootentries.contains("ajbrec.ajz", Qt::CaseInsensitive))
|
if(rootentries.contains("ajbrec.ajz", Qt::CaseInsensitive))
|
||||||
{
|
{
|
||||||
qDebug() << "ajbrec.ajz found. Trying detectAjbrec()";
|
qDebug() << "ajbrec.ajz found. Trying detectAjbrec()";
|
||||||
if(detectAjbrec(mountpoints.at(i))) {
|
if(detectAjbrec(mounts.at(i))) {
|
||||||
m_mountpoint = mountpoints.at(i);
|
m_mountpoint = mounts.at(i);
|
||||||
qDebug() << m_device;
|
qDebug() << m_device;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -145,7 +145,7 @@ bool Autodetection::detect()
|
||||||
{
|
{
|
||||||
// GBSYSTEM folder -> Gigabeat
|
// GBSYSTEM folder -> Gigabeat
|
||||||
m_device = "gigabeatf";
|
m_device = "gigabeatf";
|
||||||
m_mountpoint = mountpoints.at(i);
|
m_mountpoint = mounts.at(i);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#if defined(Q_OS_WIN32)
|
#if defined(Q_OS_WIN32)
|
||||||
|
|
@ -154,7 +154,7 @@ bool Autodetection::detect()
|
||||||
{
|
{
|
||||||
// iPod_Control folder -> Ipod found
|
// iPod_Control folder -> Ipod found
|
||||||
// detecting of the Ipod type is done below using ipodpatcher
|
// detecting of the Ipod type is done below using ipodpatcher
|
||||||
m_mountpoint = mountpoints.at(i);
|
m_mountpoint = mounts.at(i);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
@ -205,7 +205,7 @@ bool Autodetection::detect()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QStringList Autodetection::getMountpoints()
|
QStringList Autodetection::mountpoints()
|
||||||
{
|
{
|
||||||
QStringList tempList;
|
QStringList tempList;
|
||||||
#if defined(Q_OS_WIN32)
|
#if defined(Q_OS_WIN32)
|
||||||
|
|
|
||||||
|
|
@ -41,9 +41,9 @@ public:
|
||||||
QString getMountPoint() {return m_mountpoint;}
|
QString getMountPoint() {return m_mountpoint;}
|
||||||
QString errdev(void) { return m_errdev; }
|
QString errdev(void) { return m_errdev; }
|
||||||
QString incompatdev(void) { return m_incompat; }
|
QString incompatdev(void) { return m_incompat; }
|
||||||
|
static QStringList mountpoints(void);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QStringList getMountpoints(void);
|
|
||||||
QString resolveMountPoint(QString);
|
QString resolveMountPoint(QString);
|
||||||
bool detectUsb(void);
|
bool detectUsb(void);
|
||||||
bool detectAjbrec(QString);
|
bool detectAjbrec(QString);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue