summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/base/autodetection.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2020-12-05 17:37:20 +0100
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2020-12-05 19:11:18 +0100
commit82b53ebf5400ab046c23231218415a2bb711c137 (patch)
treebe4c9364fd0860995fe1f4f04b6677fbf4a5ae91 /rbutil/rbutilqt/base/autodetection.cpp
parent0e315e848ae7ea5b226af4ab16c215119cbd3fb3 (diff)
downloadrockbox-82b53ebf5400ab046c23231218415a2bb711c137.tar.gz
rockbox-82b53ebf5400ab046c23231218415a2bb711c137.tar.bz2
rockbox-82b53ebf5400ab046c23231218415a2bb711c137.zip
rbutil: Merge finding player by USB ID with PlayerBuildInfo.
Remaining rework of player info data handling. Change-Id: I0e10cdff43e0c9fef43b3b9a30af81f1cd7c4853
Diffstat (limited to 'rbutil/rbutilqt/base/autodetection.cpp')
-rw-r--r--rbutil/rbutilqt/base/autodetection.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/rbutil/rbutilqt/base/autodetection.cpp b/rbutil/rbutilqt/base/autodetection.cpp
index 58e844b4c3..63ed9ad9ff 100644
--- a/rbutil/rbutilqt/base/autodetection.cpp
+++ b/rbutil/rbutilqt/base/autodetection.cpp
@@ -19,7 +19,6 @@
#include <QtCore>
#include "autodetection.h"
#include "rbsettings.h"
-#include "systeminfo.h"
#include "playerbuildinfo.h"
#include "../ipodpatcher/ipodpatcher.h"
@@ -82,30 +81,25 @@ bool Autodetection::detect(void)
*/
void 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, QStringList> usbids = SystemInfo::usbIdMap(SystemInfo::MapDevice);
- QMap<int, QStringList> usberror = SystemInfo::usbIdMap(SystemInfo::MapError);
-
// usb pid detection
QList<uint32_t> attached;
attached = System::listUsbIds();
int i = attached.size();
while(i--) {
- if(usbids.contains(attached.at(i))) {
- // we found a USB device that might be ambiguous.
+ QStringList a = PlayerBuildInfo::instance()->value(PlayerBuildInfo::UsbIdTargetList, attached.at(i)).toStringList();
+ if(a.size() > 0) {
struct Detected d;
d.status = PlayerOk;
- d.usbdevices = usbids.value(attached.at(i));
+ d.usbdevices = a;
m_detected.append(d);
LOG_INFO() << "[USB] detected supported player" << d.usbdevices;
}
- if(usberror.contains(attached.at(i))) {
+ QStringList b = PlayerBuildInfo::instance()->value(PlayerBuildInfo::UsbIdErrorList, attached.at(i)).toStringList();
+ if(b.size() > 0) {
struct Detected d;
d.status = PlayerMtpMode;
- d.device = usberror.value(attached.at(i)).at(0);
+ d.usbdevices = b;
m_detected.append(d);
LOG_WARNING() << "[USB] detected problem with player" << d.device;
}