summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/base/autodetection.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2012-10-06 10:44:56 +0200
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2012-10-06 13:53:09 +0200
commitc659f9979a482521950c6db74221330dc1895219 (patch)
tree5a5db5faed2dafd9a66fc31bf8187cea0eb512f3 /rbutil/rbutilqt/base/autodetection.cpp
parent71f70112b2484e45b332fd7f2da137145aa05e9d (diff)
downloadrockbox-c659f9979a482521950c6db74221330dc1895219.tar.gz
rockbox-c659f9979a482521950c6db74221330dc1895219.tar.bz2
rockbox-c659f9979a482521950c6db74221330dc1895219.zip
Allow USB IDs to be non-unique.
When retrieving USB IDs create a list of players matching to a USB ID instead of assuming only one player. This prevents non-unique IDs overwriting each other and will be used for improved autodetection later. Currently only the first ID is used during detection, and no additional IDs have been added yet. Change-Id: Ieac5594108bae708e364bd2c8df88f61fcdcbdcd
Diffstat (limited to 'rbutil/rbutilqt/base/autodetection.cpp')
-rw-r--r--rbutil/rbutilqt/base/autodetection.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/rbutil/rbutilqt/base/autodetection.cpp b/rbutil/rbutilqt/base/autodetection.cpp
index 6427d929c4..0206502202 100644
--- a/rbutil/rbutilqt/base/autodetection.cpp
+++ b/rbutil/rbutilqt/base/autodetection.cpp
@@ -43,12 +43,12 @@ bool Autodetection::detect()
// Try detection via rockbox.info / rbutil.log
QStringList mounts = Utils::mountpoints();
+ qDebug() << "[Autodetect] paths to check:" << mounts;
for(int i=0; i< mounts.size();i++)
{
// do the file checking
QDir dir(mounts.at(i));
- qDebug() << "[Autodetect] paths to check:" << mounts;
if(dir.exists())
{
// check logfile first.
@@ -205,9 +205,9 @@ bool Autodetection::detectUsb()
// usbids holds the mapping in the form
// ((VID<<16)|(PID)), targetname
// the ini file needs to hold the IDs as hex values.
- QMap<int, QString> usbids = SystemInfo::usbIdMap(SystemInfo::MapDevice);
- QMap<int, QString> usberror = SystemInfo::usbIdMap(SystemInfo::MapError);
- QMap<int, QString> usbincompat = SystemInfo::usbIdMap(SystemInfo::MapIncompatible);
+ QMap<int, QStringList> usbids = SystemInfo::usbIdMap(SystemInfo::MapDevice);
+ QMap<int, QStringList> usberror = SystemInfo::usbIdMap(SystemInfo::MapError);
+ QMap<int, QStringList> usbincompat = SystemInfo::usbIdMap(SystemInfo::MapIncompatible);
// usb pid detection
QList<uint32_t> attached;
@@ -216,12 +216,12 @@ bool Autodetection::detectUsb()
int i = attached.size();
while(i--) {
if(usbids.contains(attached.at(i))) {
- m_device = usbids.value(attached.at(i));
+ m_device = usbids.value(attached.at(i)).at(0);
qDebug() << "[USB] detected supported player" << m_device;
return true;
}
if(usberror.contains(attached.at(i))) {
- m_errdev = usberror.value(attached.at(i));
+ m_errdev = usberror.value(attached.at(i)).at(0);
qDebug() << "[USB] detected problem with player" << m_errdev;
return true;
}