Skip to content

Commit

Permalink
[qtbase] Improved online state handling. Contributes to JB#34613
Browse files Browse the repository at this point in the history
Particularly, it handles the following scenario:

1. Session state changes from Connected to Connecting
   (that could be another bug but why not?)
2. _q_networkSessionStateChanged switches online to false
3. Session state changes to Disconnected, online is already false
4. online state stays false even though another configuration
   gets connected.

With this change, when one session becomes Disconnected, a new
session is created and online state becomes true as it should.
  • Loading branch information
monich committed Dec 29, 2016
1 parent 55da2ec commit 8122f32
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/network/access/qnetworkaccessmanager.cpp
Expand Up @@ -1617,7 +1617,7 @@ void QNetworkAccessManagerPrivate::_q_networkSessionStateChanged(QNetworkSession
emit q->networkSessionConnected();
lastSessionState = state;

if (online && state == QNetworkSession::Disconnected) {
if (state == QNetworkSession::Disconnected) {
Q_FOREACH (const QNetworkConfiguration &cfg, networkConfigurationManager.allConfigurations()) {
if (cfg.state().testFlag(QNetworkConfiguration::Active)) {
reallyOnline = true;
Expand Down

0 comments on commit 8122f32

Please sign in to comment.