Don't addLink twice for the same link
This commit is contained in:
parent
dd7d4093ed
commit
4c84499e6a
2 changed files with 3 additions and 2 deletions
|
@ -454,10 +454,9 @@ void LanLinkProvider::addLink(const QString& deviceId, QSslSocket* socket, Netwo
|
|||
Q_ASSERT(mPairingHandlers.contains(deviceId));
|
||||
mPairingHandlers[deviceId]->setDeviceLink(deviceLink);
|
||||
}
|
||||
Q_EMIT onConnectionReceived(*receivedPackage, deviceLink);
|
||||
}
|
||||
|
||||
Q_EMIT onConnectionReceived(*receivedPackage, deviceLink);
|
||||
|
||||
}
|
||||
|
||||
LanPairingHandler* LanLinkProvider::createPairingHandler(DeviceLink* link)
|
||||
|
|
|
@ -246,6 +246,8 @@ void Device::addLink(const NetworkPackage& identityPackage, DeviceLink* link)
|
|||
{
|
||||
//qCDebug(KDECONNECT_CORE) << "Adding link to" << id() << "via" << link->provider();
|
||||
|
||||
Q_ASSERT(!m_deviceLinks.contains(link));
|
||||
|
||||
m_protocolVersion = identityPackage.get<int>("protocolVersion", -1);
|
||||
if (m_protocolVersion != NetworkPackage::ProtocolVersion) {
|
||||
qCWarning(KDECONNECT_CORE) << m_deviceName << "- warning, device uses a different protocol version" << m_protocolVersion << "expected" << NetworkPackage::ProtocolVersion;
|
||||
|
|
Loading…
Reference in a new issue