diff options
author | Alex Blasche <alexander.blasche@qt.io> | 2018-08-16 09:16:15 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@qt.io> | 2018-08-16 12:54:02 +0000 |
commit | f602d7fef2e2f067e123e5740d4b0bf16c4ec0e2 (patch) | |
tree | 4fa53bcee779c93304572dd3b46ee7fee8b57098 /src/bluetooth/qbluetoothsocket.h | |
parent | 58a0fe8f9ab9ea3e080148f95359a355517d5cc5 (diff) |
Ensure that QBluetoothServer works with new DBus based sockets
or better ensure that the DBus based socket is not used for QBluetoothServer.
The server implementation will continue to use the raw socket implementation
for the foreseeable future. The reason being the DBus version not yet working.
convertAddress() in the server cpp was removed because it was a duplicate
implementation. Including qbluetoothsocket_bluez_p.h pulls in the
qbluetoothsocketbase_p.h which provides the official convertAddress()
implementations.
Unfortunately this requires a new ctor for QBluetoothSocket which is only
specified for BlueZ builds. It is used to permit QBluetoothServer to set
the correct dptr for QBluetoothSocket.
Task-number: QTBUG-68550
Change-Id: I19298f75e9bc2ab93322d9f34e1816ad733ac6d9
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/bluetooth/qbluetoothsocket.h')
-rw-r--r-- | src/bluetooth/qbluetoothsocket.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/bluetooth/qbluetoothsocket.h b/src/bluetooth/qbluetoothsocket.h index cda64dff..cf76e8b8 100644 --- a/src/bluetooth/qbluetoothsocket.h +++ b/src/bluetooth/qbluetoothsocket.h @@ -181,6 +181,13 @@ private Q_SLOTS: protected: +#if QT_CONFIG(bluez) + //evil hack to enable QBluetoothServer on Bluez to set the desired d_ptr + explicit QBluetoothSocket(QBluetoothSocketBasePrivate *d, + QBluetoothServiceInfo::Protocol socketType, + QObject *parent = nullptr); + friend class QBluetoothServerPrivate; +#endif #ifndef QT_OSX_BLUETOOTH QBluetoothSocketBasePrivate *d_ptr; #else |