summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/autodetection.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2008-04-05 21:48:54 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2008-04-05 21:48:54 +0000
commit229c64ba67b2efad976417314eaef31de20af1a0 (patch)
tree645749d7996c748f68a5460b91dba349de6f8179 /rbutil/rbutilqt/autodetection.cpp
parent00a3e13b1fb1bdcd9dd1c56ccefcbe0c9b1e13dc (diff)
downloadrockbox-229c64ba67b2efad976417314eaef31de20af1a0.tar.gz
rockbox-229c64ba67b2efad976417314eaef31de20af1a0.zip
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
Diffstat (limited to 'rbutil/rbutilqt/autodetection.cpp')
-rw-r--r--rbutil/rbutilqt/autodetection.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/rbutil/rbutilqt/autodetection.cpp b/rbutil/rbutilqt/autodetection.cpp
index 7c194c8bbf..3684d55908 100644
--- a/rbutil/rbutilqt/autodetection.cpp
+++ b/rbutil/rbutilqt/autodetection.cpp
@@ -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);
}