From 5f60a688c6bf49d83f5a3575065ed6ce3c6fa0a0 Mon Sep 17 00:00:00 2001 From: Claudiu Olteanu Date: Tue, 18 Aug 2015 22:43:42 +0300 Subject: [PATCH] Use the address of the BTH device if its name is empty There are moments when the name of the device is not collected properly and it is unavailable. Instead of showing an empty string then print the address of the device. Signed-off-by: Claudiu Olteanu Signed-off-by: Dirk Hohndel --- qt-ui/downloadfromdivecomputer.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp index 4127376ac..907a49af6 100644 --- a/qt-ui/downloadfromdivecomputer.cpp +++ b/qt-ui/downloadfromdivecomputer.cpp @@ -554,7 +554,13 @@ void DownloadFromDCWidget::bluetoothSelectionDialogIsFinished(int result) { if (result == QDialog::Accepted) { /* Make the selected Bluetooth device default */ - ui.device->setCurrentText(btDeviceSelectionDialog->getSelectedDeviceName()); + QString selectedDeviceName = btDeviceSelectionDialog->getSelectedDeviceName(); + + if (selectedDeviceName == NULL || selectedDeviceName.isEmpty()) { + ui.device->setCurrentText(btDeviceSelectionDialog->getSelectedDeviceAddress()); + } else { + ui.device->setCurrentText(selectedDeviceName); + } } else if (result == QDialog::Rejected){ /* Disable Bluetooth download mode */ ui.bluetoothMode->setChecked(false);