Merge PR #222: Fix an issue where the app might not reconnect to the core.

This commit is contained in:
Jenkins 2019-07-10 19:52:26 +02:00
commit b4364b8af7
2 changed files with 11 additions and 0 deletions

View File

@ -406,6 +406,15 @@ void NymeaConnection::updateActiveBearers()
foreach (const QNetworkConfiguration &config, configs) {
qDebug() << "Inactive network config:" << config.name() << config.bearerTypeFamily() << config.bearerTypeName();
}
// Retrying with a new config manager:
QNetworkConfigurationManager *newMan = new QNetworkConfigurationManager(this);
qDebug() << "Trying with new config manager:";
configs = newMan->allConfigurations();
foreach (const QNetworkConfiguration &config, configs) {
qDebug() << "Config:" << config.name() << config.bearerTypeFamily() << config.bearerTypeName() << config.state();
}
newMan->deleteLater();
}
if (m_availableBearerTypes != availableBearerTypes) {

View File

@ -322,6 +322,8 @@ void JsonRpcClient::onInterfaceConnectedChanged(bool connected)
}
} else {
qDebug() << "JsonRpcClient: Transport connected. Starting handshake.";
// Clear anything that might be left in the buffer from a previous connection.
m_receiveBuffer.clear();
QVariantMap params;
params.insert("locale", QLocale().name());
sendCommand("JSONRPC.Hello", params, this, "helloReply");