Merge PR #161: Don't rely on NetworkManager to determine the online status

This commit is contained in:
Jenkins 2019-06-19 23:52:18 +02:00
commit 9b2c796054

View File

@ -115,15 +115,15 @@ void CloudManager::setEnabled(bool enabled)
return; return;
} }
qCDebug(dcCloud()) << "Enabling cloud connection."; qCDebug(dcCloud()) << "Cloud connection is now enabled. Trying to connect...";
if (!m_awsConnector->isConnected() && m_networkManager->state() == NetworkManager::NetworkManagerStateConnectedGlobal) { // FIXME: Ideally we'd check if the network is connected, however, on some platforms we have no reliable
connect2aws(); // way to know that yet. Let's always try to connect for now.
} connect2aws();
} else { } else {
qCDebug(dcCloud()) << "Disabling cloud connection.";
m_enabled = false; m_enabled = false;
m_awsConnector->disconnectAWS(); m_awsConnector->disconnectAWS();
emit connectionStateChanged(); emit connectionStateChanged();
qCDebug(dcCloud()) << "Cloud connection is now disabled.";
} }
} }