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>
This commit is contained in:
Dirk Hohndel 2019-03-20 07:31:24 -07:00
parent 643f4a5726
commit c69ca4df80
3 changed files with 4 additions and 27 deletions

View file

@ -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()