Guarding by "hasWebDataServices"

This commit is contained in:
Klaus Basan
2020-02-15 20:36:50 +01:00
committed by Mat Sutcliffe
parent 70e08fdf8b
commit 14ab60cb73
5 changed files with 65 additions and 50 deletions

View File

@@ -49,8 +49,13 @@ namespace BlackGui
this->setAcceptDrops(true);
this->setAcceptedMetaTypeIds({qMetaTypeId<CAircraftIcaoCode>(), qMetaTypeId<CAircraftIcaoCodeList>()});
ui->le_Aircraft->setValidator(new CUpperCaseValidator(this));
connect(ui->le_Aircraft, &QLineEdit::editingFinished, this, &CDbAircraftIcaoSelectorComponent::onDataChanged);
connect(sApp->getWebDataServices(), &CWebDataServices::dataRead, this, &CDbAircraftIcaoSelectorComponent::onCodesRead, Qt::QueuedConnection);
if (sApp && sApp->hasWebDataServices())
{
connect(sApp->getWebDataServices(), &CWebDataServices::dataRead, this, &CDbAircraftIcaoSelectorComponent::onCodesRead, Qt::QueuedConnection);
}
this->onCodesRead(CEntityFlags::AircraftIcaoEntity, CEntityFlags::ReadFinished, sApp->getWebDataServices()->getAircraftIcaoCodesCount());
}