Fix abort when Bluetooth mode is default

Commit dec47e11cd introduces a SIGSEGV in case the user has Bluetooth
download selected from its previous sessions. Accessing the "Import from
dive computer" crashes immediately. Reverting a small part of commit
dec47e11cd solves this.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This commit is contained in:
Jan Mulder 2017-05-28 12:29:26 +02:00 committed by Dirk Hohndel
parent 057f46f854
commit 84b1b63d46

View file

@ -70,10 +70,6 @@ DownloadFromDCWidget::DownloadFromDCWidget(QWidget *parent, Qt::WindowFlags f) :
connect(timer, SIGNAL(timeout()), this, SLOT(updateProgressBar()));
connect(close, SIGNAL(activated()), this, SLOT(close()));
connect(quit, SIGNAL(activated()), parent, SLOT(close()));
#if defined(BT_SUPPORT) && defined(SSRF_CUSTOM_SERIAL)
connect(ui.bluetoothMode, SIGNAL(stateChanged(int)), this, SLOT(enableBluetoothMode(int)));
connect(ui.chooseBluetoothDevice, SIGNAL(clicked()), this, SLOT(selectRemoteBluetoothDevice()));
#endif
auto dc = SettingsObjectWrapper::instance()->dive_computer_settings;
if (!dc->dc_vendor().isEmpty()) {
@ -95,6 +91,8 @@ DownloadFromDCWidget::DownloadFromDCWidget(QWidget *parent, Qt::WindowFlags f) :
ui.bluetoothMode->setText(tr("Choose Bluetooth download mode"));
ui.bluetoothMode->setChecked(dc->downloadMode() == DC_TRANSPORT_BLUETOOTH);
btDeviceSelectionDialog = 0;
connect(ui.bluetoothMode, SIGNAL(stateChanged(int)), this, SLOT(enableBluetoothMode(int)));
connect(ui.chooseBluetoothDevice, SIGNAL(clicked()), this, SLOT(selectRemoteBluetoothDevice()));
ui.chooseBluetoothDevice->setEnabled(ui.bluetoothMode->isChecked());
#else
ui.bluetoothMode->hide();