From a8953da02d1d61038c5c94887acee68a6088cbb1 Mon Sep 17 00:00:00 2001 From: Jocke Date: Sun, 30 Sep 2018 17:46:07 +0200 Subject: 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 --- core/downloadfromdcthread.cpp | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/core/downloadfromdcthread.cpp b/core/downloadfromdcthread.cpp index 4e8dee74e..b6b5d9191 100644 --- a/core/downloadfromdcthread.cpp +++ b/core/downloadfromdcthread.cpp @@ -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 btDCs = BTDiscovery::instance()->getBtDcs(); @@ -473,16 +455,6 @@ int DCDeviceData::getDetectedVendorIndex() int DCDeviceData::getDetectedProductIndex(const QString ¤tVendorText) { - 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 btDCs = BTDiscovery::instance()->getBtDcs(); -- cgit v1.2.3-70-g09d2