Upon autodetection tell the user if an incompatible player model (newer Sansa / Nano) was found. Detection is usb based only.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16979 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dominik Riebeling 2008-04-05 21:48:54 +00:00
parent 00a3e13b1f
commit 229c64ba67
5 changed files with 55 additions and 2 deletions

View file

@ -172,7 +172,7 @@ bool Autodetection::detect()
return true;
}
if(m_mountpoint.isEmpty() && m_device.isEmpty() && m_errdev.isEmpty())
if(m_mountpoint.isEmpty() && m_device.isEmpty() && m_errdev.isEmpty() && m_incompat.isEmpty())
return false;
return true;
}
@ -262,6 +262,7 @@ bool Autodetection::detectUsb()
// the ini file needs to hold the IDs as hex values.
QMap<int, QString> usbids = settings->usbIdMap();
QMap<int, QString> usberror = settings->usbIdErrorMap();
QMap<int, QString> usbincompat = settings->usbIdIncompatMap();
// usb pid detection
#if defined(Q_OS_LINUX) | defined(Q_OS_MACX)
@ -293,6 +294,11 @@ bool Autodetection::detectUsb()
qDebug() << "detected device with problems via usb!";
return true;
}
if(usbincompat.contains(id)) {
m_incompat = usbincompat.value(id);
qDebug() << "detected incompatible player variant";
return true;
}
u = u->next;
}
}
@ -371,6 +377,14 @@ bool Autodetection::detectUsb()
qDebug() << "detected device with problems via usb!";
return true;
}
if(usbincompat.contains(id)) {
m_incompat = usbincompat.value(id);
// we detected an incompatible player variant
if(buffer) free(buffer);
SetupDiDestroyDeviceInfoList(deviceInfo);
qDebug() << "detectUsb: detected incompatible variant";
return true;
}
}
if(buffer) free(buffer);
}