Ref T268, moved changeRemoteAircraftModel/Enabled to CSimulatorCommon and removed duplicated code

This commit is contained in:
Klaus Basan
2018-06-06 17:56:56 +02:00
parent de4c7852a6
commit 0f931eeeb3
7 changed files with 28 additions and 51 deletions

View File

@@ -106,19 +106,14 @@ namespace BlackSimPlugin
bool CSimulatorEmulated::changeRemoteAircraftModel(const CSimulatedAircraft &aircraft)
{
if (canLog()) m_monitorWidget->appendReceivingCall(Q_FUNC_INFO, aircraft.toQString());
return true;
if (canLog()) { m_monitorWidget->appendReceivingCall(Q_FUNC_INFO, aircraft.toQString()); }
return CSimulatorCommon::changeRemoteAircraftEnabled(aircraft);
}
bool CSimulatorEmulated::changeRemoteAircraftEnabled(const CSimulatedAircraft &aircraft)
{
if (canLog()) m_monitorWidget->appendReceivingCall(Q_FUNC_INFO, aircraft.toQString());
const int c = m_renderedAircraft.setEnabled(aircraft.getCallsign(), aircraft.isEnabled(), true); // my own simulator list
const CCallsign cs = aircraft.getCallsign();
const bool rendered = aircraft.isEnabled();
this->updateAircraftRendered(cs, rendered); // in provider
emit this->aircraftRenderingChanged(m_renderedAircraft.findFirstByCallsign(aircraft.getCallsign(), aircraft));
return c > 0;
if (canLog()) { m_monitorWidget->appendReceivingCall(Q_FUNC_INFO, aircraft.toQString()); }
return CSimulatorCommon::changeRemoteAircraftEnabled(aircraft);
}
bool CSimulatorEmulated::updateOwnSimulatorCockpit(const CSimulatedAircraft &aircraft, const CIdentifier &originator)