diff options
author | Claudiu Olteanu <olteanu.claudiu@ymail.com> | 2015-08-18 22:42:51 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-08-20 22:45:58 -0700 |
commit | 55353bda405b5c9ccdb100dabcaef0e49b36c52e (patch) | |
tree | 09f35c1fa6f5ee6c46eba57842d0502eabffccd2 /qt-ui/btdeviceselectiondialog.cpp | |
parent | 7a7d492525191e623be543cb60ca87effbf3c8b3 (diff) | |
download | subsurface-55353bda405b5c9ccdb100dabcaef0e49b36c52e.tar.gz |
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>
Diffstat (limited to 'qt-ui/btdeviceselectiondialog.cpp')
-rw-r--r-- | qt-ui/btdeviceselectiondialog.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
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<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) |