diff options
Diffstat (limited to 'src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp')
-rw-r--r-- | src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp index 94c62ba1..bdfb0237 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp @@ -57,7 +57,6 @@ struct NativeFindResult HBLUETOOTH_DEVICE_FIND findHandle; DWORD errorCode; }; -Q_DECLARE_METATYPE(NativeFindResult) NativeFindResult::NativeFindResult() : findHandle(NULL) @@ -109,6 +108,13 @@ void QBluetoothDeviceDiscoveryAgentPrivate::start() discoveredDevices.clear(); + if (isValid() == false) { + lastError = QBluetoothDeviceDiscoveryAgent::InvalidBluetoothAdapterError; + errorString = qt_error_string(ERROR_INVALID_HANDLE); + emit q->error(lastError); + return; + } + if (!findWatcher) { findWatcher = new QFutureWatcher<QVariant>(q); QObject::connect(findWatcher, SIGNAL(finished()), q, SLOT(_q_handleFindResult())); @@ -241,3 +247,5 @@ void QBluetoothDeviceDiscoveryAgentPrivate::findClose(HBLUETOOTH_DEVICE_FIND fin } QT_END_NAMESPACE + +Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(NativeFindResult)) |