mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add the connections that we find to the model
So far this only deals with BT addresses. We also need to add other connections that we detect. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
c21845aa01
commit
a4f045abaa
3 changed files with 31 additions and 14 deletions
|
|
@ -7,6 +7,7 @@ QStringList vendorList;
|
|||
QHash<QString, QStringList> productList;
|
||||
static QHash<QString, QStringList> mobileProductList; // BT, BLE or FTDI supported DCs for mobile
|
||||
QMap<QString, dc_descriptor_t *> descriptorLookup;
|
||||
ConnectionListModel connectionListModel;
|
||||
|
||||
static QString str_error(const char *fmt, ...)
|
||||
{
|
||||
|
|
@ -193,6 +194,16 @@ QStringList DCDeviceData::getProductListFromVendor(const QString &vendor)
|
|||
return productList[vendor];
|
||||
}
|
||||
|
||||
int DCDeviceData::getMatchingAddress(const QString &vendor, const QString &product)
|
||||
{
|
||||
for (int i = 0; i < connectionListModel.rowCount(); i++) {
|
||||
QString address = connectionListModel.address(i);
|
||||
if (address.contains(product))
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
DCDeviceData * DownloadThread::data()
|
||||
{
|
||||
return m_data;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue