diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2007-09-02 12:20:44 +0000 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2007-09-02 12:20:44 +0000 |
commit | b2e651dbc874ba4f00bd46430a9b73dad54f95c2 (patch) | |
tree | f92718f48dc305c064f76329b1cfa4c87696670a /rbutil/rbutilqt/autodetection.cpp | |
parent | 20444c47a8b25ed4193a44023d404324ebd762c5 (diff) | |
download | rockbox-b2e651dbc874ba4f00bd46430a9b73dad54f95c2.tar.gz rockbox-b2e651dbc874ba4f00bd46430a9b73dad54f95c2.zip |
- 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
Diffstat (limited to 'rbutil/rbutilqt/autodetection.cpp')
-rw-r--r-- | rbutil/rbutilqt/autodetection.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/rbutil/rbutilqt/autodetection.cpp b/rbutil/rbutilqt/autodetection.cpp index 59b3373f19..f29df535ab 100644 --- a/rbutil/rbutilqt/autodetection.cpp +++ b/rbutil/rbutilqt/autodetection.cpp | |||
@@ -73,34 +73,34 @@ bool Autodetection::detect() | |||
73 | // check for some specific files in root folder | 73 | // check for some specific files in root folder |
74 | QDir root(mountpoints.at(i)); | 74 | QDir root(mountpoints.at(i)); |
75 | QStringList rootentries = root.entryList(QDir::Files); | 75 | QStringList rootentries = root.entryList(QDir::Files); |
76 | if(rootentries.contains("archos.mod", Qt::CaseSensitive)) | 76 | if(rootentries.contains("archos.mod", Qt::CaseInsensitive)) |
77 | { | 77 | { |
78 | // archos.mod in root folder -> Archos Player | 78 | // archos.mod in root folder -> Archos Player |
79 | m_device = "player"; | 79 | m_device = "player"; |
80 | m_mountpoint = mountpoints.at(i); | 80 | m_mountpoint = mountpoints.at(i); |
81 | return true; | 81 | return true; |
82 | } | 82 | } |
83 | if(rootentries.contains("ONDIOST.BIN")) | 83 | if(rootentries.contains("ONDIOST.BIN"), Qt::CaseInsensitive) |
84 | { | 84 | { |
85 | // ONDIOST.BIN in root -> Ondio FM | 85 | // ONDIOST.BIN in root -> Ondio FM |
86 | m_device = "ondiofm"; | 86 | m_device = "ondiofm"; |
87 | m_mountpoint = mountpoints.at(i); | 87 | m_mountpoint = mountpoints.at(i); |
88 | return true; | 88 | return true; |
89 | } | 89 | } |
90 | if(rootentries.contains("ONDIOSP.BIN")) | 90 | if(rootentries.contains("ONDIOSP.BIN"), Qt::CaseInsensitive) |
91 | { | 91 | { |
92 | // ONDIOSP.BIN in root -> Ondio SP | 92 | // ONDIOSP.BIN in root -> Ondio SP |
93 | m_device = "ondiosp"; | 93 | m_device = "ondiosp"; |
94 | m_mountpoint = mountpoints.at(i); | 94 | m_mountpoint = mountpoints.at(i); |
95 | return true; | 95 | return true; |
96 | } | 96 | } |
97 | if(rootentries.contains("ajbrec.ajz")) | 97 | if(rootentries.contains("ajbrec.ajz"), Qt::CaseInsensitive) |
98 | { | 98 | { |
99 | qDebug() << "it's an archos. further detection needed"; | 99 | qDebug() << "it's an archos. further detection needed"; |
100 | } | 100 | } |
101 | // detection based on player specific folders | 101 | // detection based on player specific folders |
102 | QStringList rootfolders = root.entryList(QDir::Dirs); | 102 | QStringList rootfolders = root.entryList(QDir::Dirs | QDir::NoDotAndDotDot); |
103 | if(rootfolders.contains("GBSYSTEM")) | 103 | if(rootfolders.contains("GBSYSTEM"), Qt::CaseInsensitive) |
104 | { | 104 | { |
105 | // GBSYSTEM folder -> Gigabeat | 105 | // GBSYSTEM folder -> Gigabeat |
106 | m_device = "gigabeatf"; | 106 | m_device = "gigabeatf"; |
@@ -111,7 +111,7 @@ bool Autodetection::detect() | |||
111 | } | 111 | } |
112 | 112 | ||
113 | } | 113 | } |
114 | 114 | ||
115 | int n; | 115 | int n; |
116 | //try ipodpatcher | 116 | //try ipodpatcher |
117 | struct ipod_t ipod; | 117 | struct ipod_t ipod; |
@@ -180,7 +180,8 @@ QString Autodetection::resolveMountPoint(QString device) | |||
180 | 180 | ||
181 | struct mntent *ent; | 181 | struct mntent *ent; |
182 | while((ent = getmntent(mn))) { | 182 | while((ent = getmntent(mn))) { |
183 | if(QString(ent->mnt_fsname).startsWith(device)) { | 183 | if(QString(ent->mnt_fsname).startsWith(device) |
184 | && QString(ent->mnt_type).contains("vfat", Qt::CaseInsensitive)) { | ||
184 | endmntent(mn); | 185 | endmntent(mn); |
185 | return QString(ent->mnt_dir); | 186 | return QString(ent->mnt_dir); |
186 | } | 187 | } |