mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
Avoid unnecessary bluetooth device address scanning.
When switching from a non-bluetooth computer to a bluetooh computer an unnecessary bluetooth scan may be forced. This patch will avoid the scan if the bluetooth device address is known. Signed-off-by: jme <32236882+notrege@users.noreply.github.com>
This commit is contained in:
parent
f4b35f67f6
commit
4dcc9210a9
1 changed files with 8 additions and 4 deletions
|
@ -150,6 +150,7 @@ int DownloadFromDCWidget::deviceIndex(QString deviceText)
|
|||
void DownloadFromDCWidget::DC##num##Clicked() \
|
||||
{ \
|
||||
ui.vendor->setCurrentIndex(ui.vendor->findText(qPrefDiveComputer::vendor##num())); \
|
||||
ui.device->setCurrentText(qPrefDiveComputer::device##num()); \
|
||||
productModel.setStringList(productList[qPrefDiveComputer::vendor##num()]); \
|
||||
ui.product->setCurrentIndex(ui.product->findText(qPrefDiveComputer::product##num())); \
|
||||
bool isBluetoothDevice = isBluetoothAddress(qPrefDiveComputer::device##num()); \
|
||||
|
@ -634,10 +635,13 @@ void DownloadFromDCWidget::enableBluetoothMode(int state)
|
|||
{
|
||||
ui.chooseBluetoothDevice->setEnabled(state == Qt::Checked);
|
||||
|
||||
if (state == Qt::Checked)
|
||||
selectRemoteBluetoothDevice();
|
||||
else
|
||||
ui.device->setCurrentIndex(-1);
|
||||
if (state == Qt::Checked) {
|
||||
if (ui.device->currentText().isEmpty()) {
|
||||
selectRemoteBluetoothDevice();
|
||||
} else {
|
||||
ui.device->setCurrentIndex(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue