summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Claudiu Olteanu <olteanu.claudiu@ymail.com>2015-08-18 22:43:42 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-08-20 22:45:45 -0700
commit5f60a688c6bf49d83f5a3575065ed6ce3c6fa0a0 (patch)
tree95fe30b33e4c967315b5c1141c844f9858b35509 /qt-ui
parent13083fb5245d6e7212ddc213b5ca9dc9fe10702d (diff)
downloadsubsurface-5f60a688c6bf49d83f5a3575065ed6ce3c6fa0a0.tar.gz
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 <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/downloadfromdivecomputer.cpp8
1 files changed, 7 insertions, 1 deletions
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);