Replace INetwork::CConnectionStatus with proper value object

This commit is contained in:
Roland Rossgotterer
2019-09-13 10:55:48 +02:00
parent 865b25df87
commit 4772aadc1a
42 changed files with 206 additions and 121 deletions

View File

@@ -796,11 +796,11 @@ namespace BlackCore
m_simulatorPlugin.second->changeRemoteAircraftEnabled(aircraft);
}
void CContextSimulator::xCtxNetworkConnectionStatusChanged(INetwork::ConnectionStatus from, INetwork::ConnectionStatus to)
void CContextSimulator::xCtxNetworkConnectionStatusChanged(CConnectionStatus from, CConnectionStatus to)
{
Q_UNUSED(from);
BLACK_VERIFY_X(this->getIContextNetwork(), Q_FUNC_INFO, "Missing network context");
if (to == INetwork::Connected && this->getIContextNetwork())
if (to.isConnected() && this->getIContextNetwork())
{
m_networkSessionId = this->getIContextNetwork()->getConnectedServer().getServerSessionId(false);
if (m_simulatorPlugin.second) // check in case the plugin has been unloaded
@@ -808,7 +808,7 @@ namespace BlackCore
m_simulatorPlugin.second->setFlightNetworkConnected(true);
}
}
else if (INetwork::isDisconnectedStatus(to))
else if (to.isDisconnected())
{
m_networkSessionId.clear();
m_aircraftMatcher.clearMatchingStatistics();