summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/autodetection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilqt/autodetection.cpp')
-rw-r--r--rbutil/rbutilqt/autodetection.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/rbutil/rbutilqt/autodetection.cpp b/rbutil/rbutilqt/autodetection.cpp
index 7399907f15..7c830b17c2 100644
--- a/rbutil/rbutilqt/autodetection.cpp
+++ b/rbutil/rbutilqt/autodetection.cpp
@@ -64,9 +64,9 @@ bool Autodetection::detect()
64 { 64 {
65 // do the file checking 65 // do the file checking
66 QDir dir(mountpoints.at(i)); 66 QDir dir(mountpoints.at(i));
67 qDebug() << "paths to check for player specific files:" << mountpoints;
67 if(dir.exists()) 68 if(dir.exists())
68 { 69 {
69 qDebug() << "file checking:" << mountpoints.at(i);
70 // check logfile first. 70 // check logfile first.
71 if(QFile(mountpoints.at(i) + "/.rockbox/rbutil.log").exists()) { 71 if(QFile(mountpoints.at(i) + "/.rockbox/rbutil.log").exists()) {
72 QSettings log(mountpoints.at(i) + "/.rockbox/rbutil.log", 72 QSettings log(mountpoints.at(i) + "/.rockbox/rbutil.log",
@@ -153,7 +153,10 @@ bool Autodetection::detect()
153 } 153 }
154 154
155 int n; 155 int n;
156 //try ipodpatcher 156 // try ipodpatcher
157 // initialize sector buffer. Needed.
158 ipod_sectorbuf = NULL;
159 ipod_alloc_buffer(&ipod_sectorbuf, BUFFER_SIZE);
157 struct ipod_t ipod; 160 struct ipod_t ipod;
158 n = ipod_scan(&ipod); 161 n = ipod_scan(&ipod);
159 if(n == 1) { 162 if(n == 1) {
@@ -165,8 +168,13 @@ bool Autodetection::detect()
165 else { 168 else {
166 qDebug() << "ipodpatcher: no Ipod found." << n; 169 qDebug() << "ipodpatcher: no Ipod found." << n;
167 } 170 }
171 free(ipod_sectorbuf);
172 ipod_sectorbuf = NULL;
168 173
169 //try sansapatcher 174 // try sansapatcher
175 // initialize sector buffer. Needed.
176 sansa_sectorbuf = NULL;
177 sansa_alloc_buffer(&sansa_sectorbuf, BUFFER_SIZE);
170 struct sansa_t sansa; 178 struct sansa_t sansa;
171 n = sansa_scan(&sansa); 179 n = sansa_scan(&sansa);
172 if(n == 1) { 180 if(n == 1) {
@@ -178,6 +186,8 @@ bool Autodetection::detect()
178 else { 186 else {
179 qDebug() << "sansapatcher: no Sansa found." << n; 187 qDebug() << "sansapatcher: no Sansa found." << n;
180 } 188 }
189 free(sansa_sectorbuf);
190 sansa_sectorbuf = NULL;
181 191
182 if(m_mountpoint.isEmpty() && m_device.isEmpty() && m_errdev.isEmpty() && m_incompat.isEmpty()) 192 if(m_mountpoint.isEmpty() && m_device.isEmpty() && m_errdev.isEmpty() && m_incompat.isEmpty())
183 return false; 193 return false;
@@ -288,7 +298,8 @@ QString Autodetection::resolveMountPoint(QString device)
288 } 298 }
289 299
290 } 300 }
291 return result + ":/"; 301 if(!result.isEmpty())
302 return result + ":/";
292#endif 303#endif
293 return QString(""); 304 return QString("");
294} 305}