Fix condition to set status to disconnected
This commit is contained in:
parent
32b2907e67
commit
25ace0eb17
|
@ -846,7 +846,7 @@ void SyncthingConnection::handleAdditionalRequestCanceled()
|
|||
if (m_reconnecting) {
|
||||
// if reconnection flag is set, instantly etstablish a new connection ...
|
||||
continueReconnecting();
|
||||
} else if (hasPendingRequests()) {
|
||||
} else if (!hasPendingRequests()) {
|
||||
// ... otherwise declare we're disconnected if that was the last pending request
|
||||
setStatus(SyncthingStatus::Disconnected);
|
||||
}
|
||||
|
|
|
@ -592,6 +592,7 @@ void ConnectionTests::testRequestingQrCode()
|
|||
void ConnectionTests::testDisconnecting()
|
||||
{
|
||||
cerr << "\n - Disconnecting ..." << endl;
|
||||
waitForConnected();
|
||||
waitForConnection(defaultDisconnect(), 1000, connectionSignal(&SyncthingConnection::statusChanged));
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE("disconnected", QStringLiteral("disconnected"), m_connection.statusText());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue