mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-23 03:52:45 -05:00
Log failures in mountpoint resolving, log filesystem formats in mountpoints().
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25718 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
91bdc3ea90
commit
5185d9e30a
1 changed files with 28 additions and 11 deletions
|
|
@ -238,6 +238,7 @@ QStringList Autodetection::mountpoints()
|
||||||
for(int i=0; i<list.size();i++)
|
for(int i=0; i<list.size();i++)
|
||||||
{
|
{
|
||||||
tempList << list.at(i).absolutePath();
|
tempList << list.at(i).absolutePath();
|
||||||
|
qDebug() << "[Autodetection] Mounted on" << list.at(i).absolutePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(Q_OS_MACX) || defined(Q_OS_OPENBSD)
|
#elif defined(Q_OS_MACX) || defined(Q_OS_OPENBSD)
|
||||||
|
|
@ -247,6 +248,8 @@ QStringList Autodetection::mountpoints()
|
||||||
num = getmntinfo(&mntinf, MNT_WAIT);
|
num = getmntinfo(&mntinf, MNT_WAIT);
|
||||||
while(num--) {
|
while(num--) {
|
||||||
tempList << QString(mntinf->f_mntonname);
|
tempList << QString(mntinf->f_mntonname);
|
||||||
|
qDebug() << "[Autodetection] Mounted on" << mntinf->f_mntonname
|
||||||
|
<< "is" << mntinf->f_mntfromname << "type" << mntinf->f_fstypename;
|
||||||
mntinf++;
|
mntinf++;
|
||||||
}
|
}
|
||||||
#elif defined(Q_OS_LINUX)
|
#elif defined(Q_OS_LINUX)
|
||||||
|
|
@ -256,8 +259,11 @@ QStringList Autodetection::mountpoints()
|
||||||
return QStringList("");
|
return QStringList("");
|
||||||
|
|
||||||
struct mntent *ent;
|
struct mntent *ent;
|
||||||
while((ent = getmntent(mn)))
|
while((ent = getmntent(mn))) {
|
||||||
tempList << QString(ent->mnt_dir);
|
tempList << QString(ent->mnt_dir);
|
||||||
|
qDebug() << "[Autodetection] Mounted on" << ent->mnt_dir
|
||||||
|
<< "is" << ent->mnt_fsname << "type" << ent->mnt_type;
|
||||||
|
}
|
||||||
endmntent(mn);
|
endmntent(mn);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
@ -284,12 +290,18 @@ QString Autodetection::resolveMountPoint(QString device)
|
||||||
while((ent = getmntent(mn))) {
|
while((ent = getmntent(mn))) {
|
||||||
// Check for valid filesystem. Allow hfs too, as an Ipod might be a
|
// Check for valid filesystem. Allow hfs too, as an Ipod might be a
|
||||||
// MacPod.
|
// MacPod.
|
||||||
if(QString(ent->mnt_fsname) == device
|
if(QString(ent->mnt_fsname) == device) {
|
||||||
&& (QString(ent->mnt_type).contains("vfat", Qt::CaseInsensitive)
|
QString result;
|
||||||
|| QString(ent->mnt_type).contains("hfs", Qt::CaseInsensitive))) {
|
if(QString(ent->mnt_type).contains("vfat", Qt::CaseInsensitive)
|
||||||
endmntent(mn);
|
|| QString(ent->mnt_type).contains("hfs", Qt::CaseInsensitive)) {
|
||||||
qDebug() << "[Autodetect] resolved mountpoint is:" << ent->mnt_dir;
|
qDebug() << "[Autodetect] resolved mountpoint is:" << ent->mnt_dir;
|
||||||
return QString(ent->mnt_dir);
|
result = QString(ent->mnt_dir);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
qDebug() << "[Autodetect] mountpoint is wrong filesystem!";
|
||||||
|
}
|
||||||
|
endmntent(mn);
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
endmntent(mn);
|
endmntent(mn);
|
||||||
|
|
@ -304,12 +316,17 @@ QString Autodetection::resolveMountPoint(QString device)
|
||||||
while(num--) {
|
while(num--) {
|
||||||
// Check for valid filesystem. Allow hfs too, as an Ipod might be a
|
// Check for valid filesystem. Allow hfs too, as an Ipod might be a
|
||||||
// MacPod.
|
// MacPod.
|
||||||
if(QString(mntinf->f_mntfromname) == device
|
if(QString(mntinf->f_mntfromname) == device) {
|
||||||
&& (QString(mntinf->f_fstypename).contains("msdos", Qt::CaseInsensitive)
|
if(QString(mntinf->f_fstypename).contains("msdos", Qt::CaseInsensitive)
|
||||||
|| QString(mntinf->f_fstypename).contains("hfs", Qt::CaseInsensitive))) {
|
|| QString(mntinf->f_fstypename).contains("hfs", Qt::CaseInsensitive)) {
|
||||||
qDebug() << "[Autodetect] resolved mountpoint is:" << mntinf->f_mntonname;
|
qDebug() << "[Autodetect] resolved mountpoint is:" << mntinf->f_mntonname;
|
||||||
return QString(mntinf->f_mntonname);
|
return QString(mntinf->f_mntonname);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
qDebug() << "[Autodetect] mountpoint is wrong filesystem!";
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
}
|
||||||
mntinf++;
|
mntinf++;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue