diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2019-03-20 07:31:24 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-03-20 09:07:17 -0700 |
commit | c69ca4df80c9c74aa842b7f1fb3c44b22ae3232e (patch) | |
tree | d502a697cb55f9837c390d4ba08f54ebbaa2e664 /core/downloadfromdcthread.cpp | |
parent | 643f4a5726926b86693b442e318f40cf28fee04a (diff) | |
download | subsurface-c69ca4df80c9c74aa842b7f1fb3c44b22ae3232e.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 214854342..e2db8b66e 100644 --- a/core/downloadfromdcthread.cpp +++ b/core/downloadfromdcthread.cpp @@ -287,12 +287,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() |