diff --git a/core/backends/bluetooth/bluetoothlinkprovider.cpp b/core/backends/bluetooth/bluetoothlinkprovider.cpp index bd779a6de..25ff23dd9 100644 --- a/core/backends/bluetooth/bluetoothlinkprovider.cpp +++ b/core/backends/bluetooth/bluetoothlinkprovider.cpp @@ -89,6 +89,8 @@ void BluetoothLinkProvider::connectError() void BluetoothLinkProvider::addLink(BluetoothDeviceLink *deviceLink, const QString &deviceId) { + Q_EMIT onConnectionReceived(deviceLink); + qCDebug(KDECONNECT_CORE) << "BluetoothLinkProvider::addLink executed"; if (mLinks.contains(deviceId)) { delete mLinks.take(deviceId); // not calling deleteLater because this triggers onLinkDestroyed @@ -217,8 +219,6 @@ void BluetoothLinkProvider::clientIdentityReceived(const QBluetoothAddress &peer if (success) { qCDebug(KDECONNECT_CORE) << "BluetoothLinkProvider Handshaking done (I'm the new device)"; - Q_EMIT onConnectionReceived(deviceLink); - // We kill any possible link from this same device addLink(deviceLink, deviceInfo.id); @@ -312,8 +312,6 @@ void BluetoothLinkProvider::serverDataReceived(const QBluetoothAddress &peer, QS DeviceInfo deviceInfo = deviceInfo.FromIdentityPacketAndCert(receivedPacket, receivedCertificate); BluetoothDeviceLink *deviceLink = new BluetoothDeviceLink(deviceInfo, this, mSockets[peer], socket); - Q_EMIT onConnectionReceived(deviceLink); - addLink(deviceLink, deviceInfo.id); }