Index: autodetection.cpp =================================================================== --- autodetection.cpp (revision 15092) +++ autodetection.cpp (working copy) @@ -26,6 +26,11 @@ #if defined(Q_OS_LINUX) #include #endif +#if defined(Q_OS_MACX) +#include +#include +#include +#endif #if defined(Q_OS_WIN32) #if defined(UNICODE) #define _UNICODE @@ -163,20 +168,24 @@ QStringList Autodetection::getMountpoints() { + QStringList tempList; #if defined(Q_OS_WIN32) - QStringList tempList; QFileInfoList list = QDir::drives(); for(int i=0; if_mntoname); + mntinf++; + } #elif defined(Q_OS_LINUX) - QStringList tempList; FILE *mn = setmntent("/etc/mtab", "r"); if(!mn) @@ -187,10 +196,10 @@ tempList << QString(ent->mnt_dir); endmntent(mn); - return tempList; #else #error Unknown Plattform #endif + return tempList; } QString Autodetection::resolveMountPoint(QString device) @@ -213,6 +222,19 @@ endmntent(mn); #endif + +#if defined(Q_OS_MACX) + int num; + struct statfs *mntinf; + + num = getmntinfo(&mntinf, MNT_WAIT); + while(num--) { + if(QString(mntinf->f_mnfromname).startsWith(device) + && QString(mntinf->f_fstypename).contains("vfat", Qt::CaseInsensitive)) + return QString(mntinf->f_mntoname); + mntinf++; + } +#endif return QString(""); }