diff options
author | 2019-03-20 07:31:24 -0700 | |
---|---|---|
committer | 2019-04-04 15:18:07 -0700 | |
commit | c792c00f072d8d9ff838393b3e5fa0b2a655e422 (patch) | |
tree | eed938239d56083077a5d1d6971c35c586b2e42e /core/downloadfromdcthread.cpp | |
parent | f1371adbb87dbfd37d5cc6619aac5b733df0d0e2 (diff) | |
download | subsurface-c792c00f072d8d9ff838393b3e5fa0b2a655e422.tar.gz |
Core: simplify ConnectionListModel
The complicated setup with the AddressRole is unnecessary. All we want to be
able to do is get the index of a specific text in the list. In hindsight I am
puzzled why I implemented this in such a complex fashion.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/downloadfromdcthread.cpp')
-rw-r--r-- | core/downloadfromdcthread.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/core/downloadfromdcthread.cpp b/core/downloadfromdcthread.cpp index 8e937346d..c5f75cba2 100644 --- a/core/downloadfromdcthread.cpp +++ b/core/downloadfromdcthread.cpp @@ -297,12 +297,8 @@ QStringList DCDeviceData::getProductListFromVendor(const QString &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; + Q_UNUSED(vendor) + return connectionListModel.indexOf(product); } DCDeviceData *DownloadThread::data() |