Changeset 3c022d8 in subsurface


Ignore:
Timestamp:
Dec 31, 2017, 7:56:33 AM (3 weeks ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
779292a
Parents:
a1cd2f2e
git-author:
Berthold Stoeger <bstoeger@…> (12/31/17 02:44:29)
git-committer:
Dirk Hohndel <dirk@…> (12/31/17 07:56:33)
Message:

Get Bluetooth device nam from preferences if dialog wasn't shown

If the BT dialog hasn't been shown, the device name was taken from
the text field, which contained a formatted string. The device open
would then fail.

Fixes #1002

Signed-off-by: Berthold Stoeger <bstoeger@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • desktop-widgets/downloadfromdivecomputer.cpp

    ra225f625 r3c022d8  
    293293#if defined(BT_SUPPORT)
    294294        data->setBluetoothMode(ui.bluetoothMode->isChecked());
    295         if (data->bluetoothMode() && btDeviceSelectionDialog != NULL) {
    296                 // Get the selected device address
    297                 data->setDevName(btDeviceSelectionDialog->getSelectedDeviceAddress());
    298                 data->setDevBluetoothName(btDeviceSelectionDialog->getSelectedDeviceName());
     295        if (data->bluetoothMode()) {
     296                // Get the selected device address from dialog or from preferences
     297                if (btDeviceSelectionDialog != NULL) {
     298                        data->setDevName(btDeviceSelectionDialog->getSelectedDeviceAddress());
     299                        data->setDevBluetoothName(btDeviceSelectionDialog->getSelectedDeviceName());
     300                } else {
     301                        auto dc = SettingsObjectWrapper::instance()->dive_computer_settings;
     302                        data->setDevName(dc->dc_device());
     303                        data->setDevBluetoothName(dc->dc_device_name());
     304                }
    299305        } else
    300306                // this breaks an "else if" across lines... not happy...
Note: See TracChangeset for help on using the changeset viewer.