mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 01:45:38 +08:00
Ref T292, Ref T285 use CEntityFlags::isFinishedReadState to also check against restricted read plus refactoring
This commit is contained in:
@@ -33,31 +33,32 @@ namespace BlackGui
|
||||
ui->setupUi(this);
|
||||
this->setViewWithIndicator(ui->tvp_Countries);
|
||||
ui->tvp_Countries->setResizeMode(CViewBaseNonTemplate::ResizingOnce);
|
||||
connect(ui->tvp_Countries, &CCountryView::requestNewBackendData, this, &CDbCountryComponent::ps_reload);
|
||||
connect(ui->tvp_Countries, &CCountryView::requestNewBackendData, this, &CDbCountryComponent::onReload);
|
||||
|
||||
// filter and drag and drop
|
||||
ui->tvp_Countries->setFilterWidget(ui->filter_CountryComponent);
|
||||
ui->tvp_Countries->allowDragDrop(true, false);
|
||||
|
||||
connect(sApp->getWebDataServices(), &CWebDataServices::dataRead, this, &CDbCountryComponent::ps_countriesRead);
|
||||
this->ps_countriesRead(CEntityFlags::CountryEntity, CEntityFlags::ReadFinished, sGui->getWebDataServices()->getCountriesCount());
|
||||
connect(sApp->getWebDataServices(), &CWebDataServices::dataRead, this, &CDbCountryComponent::onCountriesRead);
|
||||
this->onCountriesRead(CEntityFlags::CountryEntity, CEntityFlags::ReadFinished, sGui->getWebDataServices()->getCountriesCount());
|
||||
}
|
||||
|
||||
CDbCountryComponent::~CDbCountryComponent()
|
||||
{ }
|
||||
|
||||
void CDbCountryComponent::ps_countriesRead(CEntityFlags::Entity entity, CEntityFlags::ReadState readState, int count)
|
||||
void CDbCountryComponent::onCountriesRead(CEntityFlags::Entity entity, CEntityFlags::ReadState readState, int count)
|
||||
{
|
||||
Q_UNUSED(count);
|
||||
if (entity.testFlag(CEntityFlags::CountryEntity) && readState == CEntityFlags::ReadFinished)
|
||||
if (!sGui || sGui->isShuttingDown() || !sGui->getWebDataServices()) { return; }
|
||||
if (entity.testFlag(CEntityFlags::CountryEntity) && CEntityFlags::isFinishedReadState(readState))
|
||||
{
|
||||
ui->tvp_Countries->updateContainerMaybeAsync(sApp->getWebDataServices()->getCountries());
|
||||
}
|
||||
}
|
||||
|
||||
void CDbCountryComponent::ps_reload()
|
||||
void CDbCountryComponent::onReload()
|
||||
{
|
||||
if (!sGui || !sGui->getWebDataServices()) { return; }
|
||||
if (!sGui || sGui->isShuttingDown() || !sGui->getWebDataServices()) { return; }
|
||||
sApp->getWebDataServices()->triggerLoadingDirectlyFromDb(CEntityFlags::CountryEntity);
|
||||
}
|
||||
} // ns
|
||||
|
||||
Reference in New Issue
Block a user