mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 18:55:38 +08:00
ref #803, do not use synchronize from another thread
* changed info component to use admit * removed web service synchronize
This commit is contained in:
@@ -175,16 +175,9 @@ namespace BlackCore
|
|||||||
return (this->getModelsCount() > 0) && (this->getLiveriesCount() > 0) && (this->getDistributorsCount() > 0) && (this->getAircraftIcaoCodesCount() > 0);
|
return (this->getModelsCount() > 0) && (this->getLiveriesCount() > 0) && (this->getDistributorsCount() > 0) && (this->getAircraftIcaoCodesCount() > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CWebDataServices::synchronizeDbCaches(CEntityFlags::Entity entities)
|
|
||||||
{
|
|
||||||
if (this->m_infoDataReader) { this->m_infoDataReader->synchronizeCaches(entities); }
|
|
||||||
if (this->m_modelDataReader) { this->m_modelDataReader->synchronizeCaches(entities); }
|
|
||||||
if (this->m_icaoDataReader) { this->m_icaoDataReader->synchronizeCaches(entities); }
|
|
||||||
if (this->m_airportDataReader) { this->m_airportDataReader->synchronizeCaches(entities); }
|
|
||||||
}
|
|
||||||
|
|
||||||
void CWebDataServices::admitDbCaches(CEntityFlags::Entity entities)
|
void CWebDataServices::admitDbCaches(CEntityFlags::Entity entities)
|
||||||
{
|
{
|
||||||
|
// hint: all the readers use own threads
|
||||||
if (this->m_infoDataReader) { this->m_infoDataReader->admitCaches(entities); }
|
if (this->m_infoDataReader) { this->m_infoDataReader->admitCaches(entities); }
|
||||||
if (this->m_modelDataReader) { this->m_modelDataReader->admitCaches(entities); }
|
if (this->m_modelDataReader) { this->m_modelDataReader->admitCaches(entities); }
|
||||||
if (this->m_icaoDataReader) { this->m_icaoDataReader->admitCaches(entities); }
|
if (this->m_icaoDataReader) { this->m_icaoDataReader->admitCaches(entities); }
|
||||||
|
|||||||
@@ -349,9 +349,6 @@ namespace BlackCore
|
|||||||
//! All DB data for an aircraft entity available?
|
//! All DB data for an aircraft entity available?
|
||||||
bool hasDbAircraftData() const;
|
bool hasDbAircraftData() const;
|
||||||
|
|
||||||
//! Synchronize all DB caches
|
|
||||||
void synchronizeDbCaches(BlackMisc::Network::CEntityFlags::Entity entities);
|
|
||||||
|
|
||||||
//! Admit all DB caches
|
//! Admit all DB caches
|
||||||
void admitDbCaches(BlackMisc::Network::CEntityFlags::Entity entities);
|
void admitDbCaches(BlackMisc::Network::CEntityFlags::Entity entities);
|
||||||
|
|
||||||
|
|||||||
@@ -54,22 +54,13 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CDbLoadOverviewComponent::display()
|
void CDbLoadOverviewComponent::display()
|
||||||
{
|
{
|
||||||
if (this->isInitialized())
|
this->ps_setValues();
|
||||||
{
|
|
||||||
this->ps_setValues();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this->showLoading();
|
|
||||||
QTimer::singleShot(1000, this, &CDbLoadOverviewComponent::ps_setValues);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDbLoadOverviewComponent::ps_setValues()
|
void CDbLoadOverviewComponent::ps_setValues()
|
||||||
{
|
{
|
||||||
if (!sGui) { return; }
|
if (!sGui) { return; }
|
||||||
if (!sGui->hasWebDataServices()) { return; }
|
if (!sGui->hasWebDataServices()) { return; }
|
||||||
CDbLoadOverviewComponent::synchronizeCaches();
|
|
||||||
|
|
||||||
ui->le_AircraftIcaoCacheTs->setText(cacheTimestampForEntity(CEntityFlags::AircraftIcaoEntity));
|
ui->le_AircraftIcaoCacheTs->setText(cacheTimestampForEntity(CEntityFlags::AircraftIcaoEntity));
|
||||||
ui->le_AirlinesIcaoCacheTs->setText(cacheTimestampForEntity(CEntityFlags::AirlineIcaoEntity));
|
ui->le_AirlinesIcaoCacheTs->setText(cacheTimestampForEntity(CEntityFlags::AirlineIcaoEntity));
|
||||||
@@ -186,11 +177,6 @@ namespace BlackGui
|
|||||||
return c < 0 ? "-" : QString::number(c);
|
return c < 0 ? "-" : QString::number(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDbLoadOverviewComponent::synchronizeCaches()
|
|
||||||
{
|
|
||||||
sGui->getWebDataServices()->synchronizeDbCaches(CEntityFlags::AllDbEntities);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CDbLoadOverviewComponent::admitCaches()
|
void CDbLoadOverviewComponent::admitCaches()
|
||||||
{
|
{
|
||||||
sGui->getWebDataServices()->admitDbCaches(CEntityFlags::AllDbEntities);
|
sGui->getWebDataServices()->admitDbCaches(CEntityFlags::AllDbEntities);
|
||||||
|
|||||||
@@ -69,9 +69,6 @@ namespace BlackGui
|
|||||||
//! Formatted count for entity
|
//! Formatted count for entity
|
||||||
static QString dbCountForEntity(BlackMisc::Network::CEntityFlags::Entity entity);
|
static QString dbCountForEntity(BlackMisc::Network::CEntityFlags::Entity entity);
|
||||||
|
|
||||||
//! Synchronize caches
|
|
||||||
static void synchronizeCaches();
|
|
||||||
|
|
||||||
//! Admit caches
|
//! Admit caches
|
||||||
static void admitCaches();
|
static void admitCaches();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user