Commit fcd0c681 authored by flypig's avatar flypig

Ensure stateChanged signal connect matches disconnect

A change to the connect signal introduced a lambda function, rather than
calling stateChanged directly, so that the disconnect no longer matched
the connect. This potentially prevented the disconnect from being
applied correctly.

This change matches the connect and disconnect up again.
parent 20a249c5
......@@ -1616,11 +1616,8 @@ void QNetworkAccessManagerPrivate::createSession(const QNetworkConfiguration &co
QObject::connect(, SIGNAL(opened()), q, SIGNAL(networkSessionConnected()), Qt::QueuedConnection);
//QueuedConnection is used to avoid deleting the networkSession inside its closed signal
QObject::connect(, SIGNAL(closed()), q, SLOT(_q_networkSessionClosed()), Qt::QueuedConnection);
QObject::connect(, &QNetworkSession::stateChanged,
q, [this](QNetworkSession::State s) {
qCDebug(lcNetworkAccess) << "QNAM: network session state changed:" << s;
}, Qt::QueuedConnection);
QObject::connect(, SIGNAL(stateChanged(QNetworkSession::State)),
q, SLOT(_q_networkSessionStateChanged(QNetworkSession::State)), Qt::QueuedConnection);
QObject::connect(, SIGNAL(error(QNetworkSession::SessionError)),
q, SLOT(_q_networkSessionFailed(QNetworkSession::SessionError)));
......@@ -1652,6 +1649,7 @@ void QNetworkAccessManagerPrivate::_q_networkSessionClosed()
void QNetworkAccessManagerPrivate::_q_networkSessionStateChanged(QNetworkSession::State state)
qCDebug(lcNetworkAccess) << "QNAM: network session state changed:" << state;
if ((state == QNetworkSession::Connecting) && (!getNetworkSession())) {
qCWarning(lcNetworkAccess) << "QNAM: ignoring Connecting state received after the session closed";
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment