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:
Klaus Basan
2016-10-17 03:30:54 +02:00
parent 6322c6d302
commit 45a620dab5
8 changed files with 31 additions and 30 deletions

View File

@@ -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());
}
}
}