Fix loopback link pairing timing out when already paired
This commit is contained in:
parent
8d21ea1859
commit
3c36384078
1 changed files with 4 additions and 5 deletions
|
@ -85,15 +85,14 @@ bool PairingHandler::requestPairing()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_pairingTimeout.stop();
|
|
||||||
|
|
||||||
m_pairState = PairState::Requested;
|
m_pairState = PairState::Requested;
|
||||||
|
|
||||||
|
m_pairingTimeout.start();
|
||||||
|
|
||||||
NetworkPacket np(PACKET_TYPE_PAIR, {{QStringLiteral("pair"), true}});
|
NetworkPacket np(PACKET_TYPE_PAIR, {{QStringLiteral("pair"), true}});
|
||||||
const bool success = m_device->sendPacket(np);
|
const bool success = m_device->sendPacket(np);
|
||||||
if (success) {
|
if (!success) {
|
||||||
m_pairingTimeout.start();
|
m_pairingTimeout.stop();
|
||||||
} else {
|
|
||||||
qWarning() << m_device->name() << ": Failed to send pair request packet.";
|
qWarning() << m_device->name() << ": Failed to send pair request packet.";
|
||||||
m_pairState = PairState::NotPaired;
|
m_pairState = PairState::NotPaired;
|
||||||
Q_EMIT pairingFailed(i18n("%1: Device not reachable", m_device->name()));
|
Q_EMIT pairingFailed(i18n("%1: Device not reachable", m_device->name()));
|
||||||
|
|
Loading…
Reference in a new issue