mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 23:25:53 +08:00
refs #768, some minor formatting during debugging of mapping wizard
(found that some unnecessary model changed events are sent, will result in some refactoring)
This commit is contained in:
@@ -76,12 +76,16 @@ namespace BlackSimPlugin
|
||||
|
||||
void CSimulatorFsCommon::setOwnAircraftModel(const BlackMisc::Simulation::CAircraftModel &model)
|
||||
{
|
||||
if (getOwnAircraftModel() != model)
|
||||
if (!model.hasModelString()) { return; }
|
||||
if (this->getOwnAircraftModel() != model)
|
||||
{
|
||||
CAircraftModel newModel(model);
|
||||
newModel.setModelType(CAircraftModel::TypeOwnSimulatorModel);
|
||||
updateOwnModel(newModel);
|
||||
emit ownAircraftModelChanged(newModel);
|
||||
const bool updated = this->updateOwnModel(newModel); // update in provider (normally the context)
|
||||
if (updated)
|
||||
{
|
||||
emit this->ownAircraftModelChanged(this->getOwnAircraftModel());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user