mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
c504c08097
commit
a8953da02d
1 changed files with 0 additions and 28 deletions
|
@ -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 ¤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<BTDiscovery::btVendorProduct> btDCs = BTDiscovery::instance()->getBtDcs();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue