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>
This commit is contained in:
Claudiu Olteanu 2015-08-18 22:43:42 +03:00 committed by Dirk Hohndel
parent 13083fb524
commit 5f60a688c6

View file

@ -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);