Mobile download from DC: show the correct DC rather than the latest

Since we now keep track of up to 4 DCs we don't want to display the last used one
but rather the one that is connected.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
This commit is contained in:
Jocke 2018-09-30 17:46:07 +02:00 committed by Dirk Hohndel
parent c504c08097
commit a8953da02d

View file

@ -291,16 +291,6 @@ QStringList DCDeviceData::getProductListFromVendor(const QString &vendor)
int DCDeviceData::getMatchingAddress(const QString &vendor, const QString &product)
{
if (qPrefDiveComputer::vendor() == vendor &&
qPrefDiveComputer::product() == product) {
// we are trying to show the last dive computer selected
for (int i = 0; i < connectionListModel.rowCount(); i++) {
QString address = connectionListModel.address(i);
if (address.contains(qPrefDiveComputer::device()))
return i;
}
}
for (int i = 0; i < connectionListModel.rowCount(); i++) {
QString address = connectionListModel.address(i);
if (address.contains(product))
@ -453,14 +443,6 @@ device_data_t *DCDeviceData::internalData()
int DCDeviceData::getDetectedVendorIndex()
{
if (!qPrefDiveComputer::vendor().isEmpty()) {
// use the last one
for (int i = 0; i < vendorList.length(); i++) {
if (vendorList[i] == qPrefDiveComputer::vendor())
return i;
}
}
#if defined(BT_SUPPORT)
QList<BTDiscovery::btVendorProduct> btDCs = BTDiscovery::instance()->getBtDcs();
@ -473,16 +455,6 @@ int DCDeviceData::getDetectedVendorIndex()
int DCDeviceData::getDetectedProductIndex(const QString &currentVendorText)
{
if (!qPrefDiveComputer::vendor().isEmpty()) {
if (qPrefDiveComputer::vendor() == currentVendorText) {
// we are trying to show the last dive computer selected
for (int i = 0; i < productList[currentVendorText].length(); i++) {
if (productList[currentVendorText][i] == qPrefDiveComputer::product())
return i;
}
}
}
#if defined(BT_SUPPORT)
QList<BTDiscovery::btVendorProduct> btDCs = BTDiscovery::instance()->getBtDcs();