diff --git a/src/blackcore/simulatorcommon.cpp b/src/blackcore/simulatorcommon.cpp index 986e7f0dc..44e259271 100644 --- a/src/blackcore/simulatorcommon.cpp +++ b/src/blackcore/simulatorcommon.cpp @@ -574,7 +574,7 @@ namespace BlackCore void CSimulatorCommon::clearAllAircraft() { - m_aircraftToAddAgainWhenRemoved.clear(); + m_addAgainAircraftWhenRemoved.clear(); m_highlightedAircraft.clear(); m_callsignsToBeRendered.clear(); m_hints.clear(); diff --git a/src/blackcore/simulatorcommon.h b/src/blackcore/simulatorcommon.h index d72b16550..42eb9828c 100644 --- a/src/blackcore/simulatorcommon.h +++ b/src/blackcore/simulatorcommon.h @@ -220,7 +220,7 @@ namespace BlackCore BlackMisc::Simulation::CInterpolationAndRenderingSetup m_interpolationRenderingSetup; //!< logging, rendering etc. // some optional functionality which can be used by the sims as needed - BlackMisc::Simulation::CSimulatedAircraftList m_aircraftToAddAgainWhenRemoved; //!< add this model again when removed, normally used to change model + BlackMisc::Simulation::CSimulatedAircraftList m_addAgainAircraftWhenRemoved; //!< add this model again when removed, normally used to change model QHash m_hints; //!< last ground elevation fetched bool m_isWeatherActivated = false; //!< Is simulator weather activated? diff --git a/src/blackmisc/simulation/aircraftmodelutils.cpp b/src/blackmisc/simulation/aircraftmodelutils.cpp index a74337f38..3917e2134 100644 --- a/src/blackmisc/simulation/aircraftmodelutils.cpp +++ b/src/blackmisc/simulation/aircraftmodelutils.cpp @@ -22,7 +22,7 @@ namespace BlackMisc for (CAircraftModel &simModel : modelToBeModified) { if (!force && simModel.hasValidAircraftAndAirlineDesignator()) { continue; } // already done - CAircraftModel vPilotModel(vPilotModels.findFirstByModelStringOrDefault(simModel.getModelString())); + const CAircraftModel vPilotModel(vPilotModels.findFirstByModelStringOrDefault(simModel.getModelString())); if (!vPilotModel.hasValidDbKey()) { continue; // not found diff --git a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp index a9d465bea..2d71b7b21 100644 --- a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp +++ b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp @@ -235,7 +235,7 @@ namespace BlackSimPlugin CCallsignSet CSimulatorFsxCommon::physicallyRenderedAircraft() const { CCallsignSet callsigns(m_simConnectObjects.keys()); - callsigns.push_back(m_aircraftToAddAgainWhenRemoved.getCallsigns()); // not really rendered right now, but very soon + callsigns.push_back(m_addAgainAircraftWhenRemoved.getCallsigns()); // not really rendered right now, but very soon callsigns.push_back(m_addPendingAircraft.getCallsigns()); // not really rendered, but for the logic it should look like it is return CCallsignSet(m_simConnectObjects.keys()); } @@ -539,7 +539,7 @@ namespace BlackSimPlugin } else { - this->removeFromPendingAndAddAgainAircraft(callsign); + this->removeFromAddPendingAndAddAgainAircraft(callsign); msg = CLogMessage(this).info("Callsign '%1' removed in meantime and no longer in range") << callsign.toQString(); } break; @@ -578,7 +578,7 @@ namespace BlackSimPlugin this->requestDataForSimObject(simObject); this->requestLightsForSimObject(simObject); - this->removeFromPendingAndAddAgainAircraft(callsign); // no longer try to add + this->removeFromAddPendingAndAddAgainAircraft(callsign); // no longer try to add const bool updated = this->updateAircraftRendered(callsign, true); if (updated) { @@ -633,7 +633,7 @@ namespace BlackSimPlugin // no longer required to be added m_addPendingAircraft.removeByCallsigns(toBeRemovedCallsigns); - m_aircraftToAddAgainWhenRemoved.removeByCallsigns(toBeRemovedCallsigns); + m_addAgainAircraftWhenRemoved.removeByCallsigns(toBeRemovedCallsigns); // add aircraft, but "non blocking" if (!toBeAddedAircraft.isEmpty()) @@ -646,11 +646,11 @@ namespace BlackSimPlugin } } - void CSimulatorFsxCommon::removeFromPendingAndAddAgainAircraft(const CCallsign &callsign) + void CSimulatorFsxCommon::removeFromAddPendingAndAddAgainAircraft(const CCallsign &callsign) { if (callsign.isEmpty()) { return; } m_addPendingAircraft.removeByCallsign(callsign); - m_aircraftToAddAgainWhenRemoved.removeByCallsign(callsign); + m_addAgainAircraftWhenRemoved.removeByCallsign(callsign); } bool CSimulatorFsxCommon::simulatorReportedObjectRemoved(DWORD objectID) @@ -696,10 +696,10 @@ namespace BlackSimPlugin } // models we have to add again after removing - if (m_aircraftToAddAgainWhenRemoved.containsCallsign(callsign)) + if (m_addAgainAircraftWhenRemoved.containsCallsign(callsign)) { - const CSimulatedAircraft aircraftAddAgain = m_aircraftToAddAgainWhenRemoved.findFirstByCallsign(callsign); - m_aircraftToAddAgainWhenRemoved.removeByCallsign(callsign); + const CSimulatedAircraft aircraftAddAgain = m_addAgainAircraftWhenRemoved.findFirstByCallsign(callsign); + m_addAgainAircraftWhenRemoved.removeByCallsign(callsign); QTimer::singleShot(2500, this, [ = ] { this->physicallyAddRemoteAircraftImpl(aircraftAddAgain, AddedAfterRemoved); @@ -844,7 +844,7 @@ namespace BlackSimPlugin } this->physicallyRemoveRemoteAircraft(newRemoteAircraft.getCallsign()); - m_aircraftToAddAgainWhenRemoved.replaceOrAddByCallsign(newRemoteAircraft); + m_addAgainAircraftWhenRemoved.replaceOrAddByCallsign(newRemoteAircraft); if (this->showDebugLogMessage()) { this->debugLogMessage(Q_FUNC_INFO, QString("Cs: '%1' re-added changed model '%2', will be added again").arg(newRemoteAircraft.getCallsignAsString(), newModelString)); } return false; } @@ -856,7 +856,7 @@ namespace BlackSimPlugin return false; } - this->removeFromPendingAndAddAgainAircraft(callsign); + this->removeFromAddPendingAndAddAgainAircraft(callsign); // create AI bool adding = false; @@ -892,7 +892,7 @@ namespace BlackSimPlugin Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "wrong thread"); if (callsign.isEmpty()) { return false; } // can happen if an object is not an aircraft - this->removeFromPendingAndAddAgainAircraft(callsign); + this->removeFromAddPendingAndAddAgainAircraft(callsign); if (!m_simConnectObjects.contains(callsign)) { return false; } // already fully removed or not yet added CSimConnectObject &simObject = m_simConnectObjects[callsign]; diff --git a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.h b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.h index 49ec3319f..35d6e6f71 100644 --- a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.h +++ b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.h @@ -208,7 +208,7 @@ namespace BlackSimPlugin void addPendingAircraft(AircraftAddMode mode); //! Remove as m_addPendingAircraft and m_aircraftToAddAgainWhenRemoved - void removeFromPendingAndAddAgainAircraft(const BlackMisc::Aviation::CCallsign &callsign); + void removeFromAddPendingAndAddAgainAircraft(const BlackMisc::Aviation::CCallsign &callsign); //! Call this method to declare the simulator connected void setSimConnected();