diff options
-rw-r--r-- | qt-ui/btdeviceselectiondialog.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/qt-ui/btdeviceselectiondialog.cpp b/qt-ui/btdeviceselectiondialog.cpp index 9b97da3a9..6a2a97731 100644 --- a/qt-ui/btdeviceselectiondialog.cpp +++ b/qt-ui/btdeviceselectiondialog.cpp @@ -86,6 +86,12 @@ void BtDeviceSelectionDialog::on_save_clicked() // Save the selected device selectedRemoteDeviceInfo = QSharedPointer<QBluetoothDeviceInfo>(new QBluetoothDeviceInfo(remoteDeviceInfo)); + if (remoteDeviceDiscoveryAgent->isActive()) { + // Stop the SDP agent if the clear button is pressed and enable the Scan button + remoteDeviceDiscoveryAgent->stop(); + ui->scan->setEnabled(true); + } + // Close the device selection dialog and set the result code to Accepted accept(); } @@ -95,6 +101,12 @@ void BtDeviceSelectionDialog::on_clear_clicked() ui->dialogStatus->setText("Remote devices list was cleaned."); ui->discoveredDevicesList->clear(); ui->save->setEnabled(false); + + if (remoteDeviceDiscoveryAgent->isActive()) { + // Stop the SDP agent if the clear button is pressed and enable the Scan button + remoteDeviceDiscoveryAgent->stop(); + ui->scan->setEnabled(true); + } } void BtDeviceSelectionDialog::on_scan_clicked() |