Always try to connect to the cloud if it's enabled by settings.

pull/161/head
Michael Zanetti 2019-05-09 18:36:58 +02:00
parent 1329fab9a6
commit 31aaa54d35
1 changed files with 5 additions and 5 deletions

View File

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