aboutsummaryrefslogtreecommitdiffstats
path: root/core/downloadfromdcthread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/downloadfromdcthread.cpp')
-rw-r--r--core/downloadfromdcthread.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/downloadfromdcthread.cpp b/core/downloadfromdcthread.cpp
index 76b314da7..8abc46bcd 100644
--- a/core/downloadfromdcthread.cpp
+++ b/core/downloadfromdcthread.cpp
@@ -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;