BLE: create controller from QBtDeviceInfo

Creating it from an address is a) deprecated and b) impossible on Mac or iOS.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2017-09-16 20:21:46 -07:00
parent db38a7023d
commit 26e610c3f4
2 changed files with 6 additions and 4 deletions

View file

@ -152,7 +152,9 @@ void BtDeviceSelectionDialog::on_save_clicked()
// Save the selected device
selectedRemoteDeviceInfo = QSharedPointer<QBluetoothDeviceInfo>(new QBluetoothDeviceInfo(remoteDeviceInfo));
QString address = remoteDeviceInfo.address().isNull() ? remoteDeviceInfo.deviceUuid().toString() :
remoteDeviceInfo.address().toString();
saveBtDeviceInfo(address.toUtf8().constData(), remoteDeviceInfo);
if (remoteDeviceDiscoveryAgent->isActive()) {
// Stop the SDP agent if the clear button is pressed and enable the Scan button
remoteDeviceDiscoveryAgent->stop();