mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add implementation for device discovery agent initialization (Windows)
Register the metatypes needed for Windows platforms and initialize our custom device discovery agent. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
7a7d492525
commit
55353bda40
1 changed files with 9 additions and 3 deletions
|
@ -458,7 +458,14 @@ void BtDeviceSelectionDialog::updateLocalDeviceInformation()
|
|||
void BtDeviceSelectionDialog::initializeDeviceDiscoveryAgent()
|
||||
{
|
||||
#if defined(Q_OS_WIN)
|
||||
// TODO initialize the discovery agent
|
||||
// Register QBluetoothDeviceInfo metatype
|
||||
qRegisterMetaType<QBluetoothDeviceInfo>();
|
||||
|
||||
// Register QBluetoothDeviceDiscoveryAgent metatype (Needed for QBluetoothDeviceDiscoveryAgent::Error)
|
||||
qRegisterMetaType<QBluetoothDeviceDiscoveryAgent::Error>();
|
||||
|
||||
// Intialize the discovery agent
|
||||
remoteDeviceDiscoveryAgent = new WinBluetoothDeviceDiscoveryAgent(this);
|
||||
#else
|
||||
// Intialize the discovery agent
|
||||
remoteDeviceDiscoveryAgent = new QBluetoothDeviceDiscoveryAgent(localDevice->address());
|
||||
|
@ -472,14 +479,13 @@ void BtDeviceSelectionDialog::initializeDeviceDiscoveryAgent()
|
|||
ui->clear->setEnabled(false);
|
||||
return;
|
||||
}
|
||||
|
||||
#endif
|
||||
connect(remoteDeviceDiscoveryAgent, SIGNAL(deviceDiscovered(QBluetoothDeviceInfo)),
|
||||
this, SLOT(addRemoteDevice(QBluetoothDeviceInfo)));
|
||||
connect(remoteDeviceDiscoveryAgent, SIGNAL(finished()),
|
||||
this, SLOT(remoteDeviceScanFinished()));
|
||||
connect(remoteDeviceDiscoveryAgent, SIGNAL(error(QBluetoothDeviceDiscoveryAgent::Error)),
|
||||
this, SLOT(deviceDiscoveryError(QBluetoothDeviceDiscoveryAgent::Error)));
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
|
|
Loading…
Add table
Reference in a new issue