From 55353bda405b5c9ccdb100dabcaef0e49b36c52e Mon Sep 17 00:00:00 2001 From: Claudiu Olteanu Date: Tue, 18 Aug 2015 22:42:51 +0300 Subject: 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 Signed-off-by: Dirk Hohndel --- qt-ui/btdeviceselectiondialog.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'qt-ui/btdeviceselectiondialog.cpp') diff --git a/qt-ui/btdeviceselectiondialog.cpp b/qt-ui/btdeviceselectiondialog.cpp index 65f42d9ed..bd7ad1e3d 100644 --- a/qt-ui/btdeviceselectiondialog.cpp +++ b/qt-ui/btdeviceselectiondialog.cpp @@ -458,7 +458,14 @@ void BtDeviceSelectionDialog::updateLocalDeviceInformation() void BtDeviceSelectionDialog::initializeDeviceDiscoveryAgent() { #if defined(Q_OS_WIN) - // TODO initialize the discovery agent + // Register QBluetoothDeviceInfo metatype + qRegisterMetaType(); + + // Register QBluetoothDeviceDiscoveryAgent metatype (Needed for QBluetoothDeviceDiscoveryAgent::Error) + qRegisterMetaType(); + + // 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) -- cgit v1.2.3-70-g09d2