mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05:34 +08:00
Avoid redundant update of model set ui
* added changed simulator in signal * only changed once when cache changed
This commit is contained in:
@@ -143,8 +143,9 @@ namespace BlackGui
|
||||
connect(ui->tvp_RenderedAircraft, &CAircraftModelView::objectChanged, this, &CMappingComponent::onChangedSimulatedAircraftInView);
|
||||
|
||||
// with external core models might be already available
|
||||
this->onModelSetSimulatorChanged(ui->comp_SimulatorSelector->getValue());
|
||||
this->onModelSetChanged();
|
||||
const CSimulatorInfo sim(ui->comp_SimulatorSelector->getValue());
|
||||
this->onModelSetSimulatorChanged(sim);
|
||||
this->onModelSetChanged(sim);
|
||||
}
|
||||
|
||||
CMappingComponent::~CMappingComponent()
|
||||
@@ -168,7 +169,7 @@ namespace BlackGui
|
||||
return ui->tvp_AircraftModels->container().findModelsStartingWith(modelName, cs);
|
||||
}
|
||||
|
||||
void CMappingComponent::onModelSetChanged()
|
||||
void CMappingComponent::onModelSetChanged(const CSimulatorInfo &simulator)
|
||||
{
|
||||
if (ui->tvp_AircraftModels->displayAutomatically())
|
||||
{
|
||||
@@ -176,7 +177,7 @@ namespace BlackGui
|
||||
}
|
||||
else
|
||||
{
|
||||
CLogMessage(this).info("Models loaded, you can update the model view");
|
||||
CLogMessage(this).info("Model set loaded ('%1'), you can update the model view") << simulator.toQString(true);
|
||||
}
|
||||
|
||||
// change completer
|
||||
|
||||
@@ -79,9 +79,9 @@ namespace BlackGui
|
||||
|
||||
private:
|
||||
//! Aircraft models available
|
||||
void onModelSetChanged();
|
||||
void onModelSetChanged(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||
|
||||
//! Changed count
|
||||
//! Changed count of rendered or aircraft model count
|
||||
void onRowCountChanged(int count, bool withFilter);
|
||||
|
||||
//! Simulated aircraft did change in view
|
||||
|
||||
Reference in New Issue
Block a user