forked from len0rd/rockbox
- check for specific files / folders case-insensitive
- linux: when detecting the mountpoint only accept vfat drives git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14578 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
20444c47a8
commit
b2e651dbc8
1 changed files with 9 additions and 8 deletions
|
|
@ -73,34 +73,34 @@ bool Autodetection::detect()
|
||||||
// check for some specific files in root folder
|
// check for some specific files in root folder
|
||||||
QDir root(mountpoints.at(i));
|
QDir root(mountpoints.at(i));
|
||||||
QStringList rootentries = root.entryList(QDir::Files);
|
QStringList rootentries = root.entryList(QDir::Files);
|
||||||
if(rootentries.contains("archos.mod", Qt::CaseSensitive))
|
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 = mountpoints.at(i);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if(rootentries.contains("ONDIOST.BIN"))
|
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 = mountpoints.at(i);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if(rootentries.contains("ONDIOSP.BIN"))
|
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 = mountpoints.at(i);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if(rootentries.contains("ajbrec.ajz"))
|
if(rootentries.contains("ajbrec.ajz"), Qt::CaseInsensitive)
|
||||||
{
|
{
|
||||||
qDebug() << "it's an archos. further detection needed";
|
qDebug() << "it's an archos. further detection needed";
|
||||||
}
|
}
|
||||||
// detection based on player specific folders
|
// detection based on player specific folders
|
||||||
QStringList rootfolders = root.entryList(QDir::Dirs);
|
QStringList rootfolders = root.entryList(QDir::Dirs | QDir::NoDotAndDotDot);
|
||||||
if(rootfolders.contains("GBSYSTEM"))
|
if(rootfolders.contains("GBSYSTEM"), Qt::CaseInsensitive)
|
||||||
{
|
{
|
||||||
// GBSYSTEM folder -> Gigabeat
|
// GBSYSTEM folder -> Gigabeat
|
||||||
m_device = "gigabeatf";
|
m_device = "gigabeatf";
|
||||||
|
|
@ -111,7 +111,7 @@ bool Autodetection::detect()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int n;
|
int n;
|
||||||
//try ipodpatcher
|
//try ipodpatcher
|
||||||
struct ipod_t ipod;
|
struct ipod_t ipod;
|
||||||
|
|
@ -180,7 +180,8 @@ QString Autodetection::resolveMountPoint(QString device)
|
||||||
|
|
||||||
struct mntent *ent;
|
struct mntent *ent;
|
||||||
while((ent = getmntent(mn))) {
|
while((ent = getmntent(mn))) {
|
||||||
if(QString(ent->mnt_fsname).startsWith(device)) {
|
if(QString(ent->mnt_fsname).startsWith(device)
|
||||||
|
&& QString(ent->mnt_type).contains("vfat", Qt::CaseInsensitive)) {
|
||||||
endmntent(mn);
|
endmntent(mn);
|
||||||
return QString(ent->mnt_dir);
|
return QString(ent->mnt_dir);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue