mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05:34 +08:00
Fixed issue with still using header instead of info object data
plus some utility functionality
This commit is contained in:
committed by
Mathew Sutcliffe
parent
b444361c7c
commit
8ad7c1e3c7
@@ -44,7 +44,7 @@ namespace BlackCore
|
||||
if (dir.isEmpty() || whatToRead == CEntityFlags::NoEntity) { return false; }
|
||||
QTimer::singleShot(0, this, [this, dir, whatToRead]()
|
||||
{
|
||||
CStatusMessageList msgs = this->readFromJsonFiles(dir, whatToRead);
|
||||
const CStatusMessageList msgs = this->readFromJsonFiles(dir, whatToRead);
|
||||
if (msgs.isFailure())
|
||||
{
|
||||
CLogMessage::preformatted(msgs);
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace BlackCore
|
||||
if (entities == CEntityFlags::NoEntity) { return CEntityFlags::NoEntity; }
|
||||
if (checkCacheTsUpfront)
|
||||
{
|
||||
CEntityFlags::Entity newerHeaderEntities = this->getEntitesWithNewerHeaderTimestamp(entities);
|
||||
CEntityFlags::Entity newerHeaderEntities = this->getEntitesWithNewerSharedInfoObject(entities);
|
||||
if (newerHeaderEntities != entities)
|
||||
{
|
||||
const CEntityFlags::Entity validInCacheEntities = (entities ^ newerHeaderEntities) & entities;
|
||||
@@ -389,7 +389,7 @@ namespace BlackCore
|
||||
const QDateTime cacheTs(this->getCacheTimestamp(entity));
|
||||
if (!cacheTs.isValid()) { return true; } // we have no cache ts
|
||||
|
||||
const QDateTime sharedInfoTimestamp(this->getLatestSharedFileHeaderTimestamp(entity));
|
||||
const QDateTime sharedInfoTimestamp(this->getLatestEntityTimestampFromSharedInfoObjects(entity));
|
||||
if (!sharedInfoTimestamp.isValid()) { return false; }
|
||||
return sharedInfoTimestamp > cacheTs;
|
||||
}
|
||||
|
||||
@@ -320,7 +320,7 @@ namespace BlackCore
|
||||
CEntityFlags::Entity CWebDataServices::triggerLoadingDirectlyFromSharedFiles(CEntityFlags::Entity whatToRead, bool checkCacheTsUpfront)
|
||||
{
|
||||
CEntityFlags::Entity triggeredRead = CEntityFlags::NoEntity;
|
||||
this->triggerReadOfSharedInfoObjects(); // trigger reload of headers
|
||||
this->triggerReadOfSharedInfoObjects(); // trigger reload of info objects (for shared)
|
||||
|
||||
if (m_icaoDataReader)
|
||||
{
|
||||
|
||||
@@ -311,12 +311,10 @@ namespace BlackGui
|
||||
void CDbLoadOverviewComponent::ps_dataLoaded(CEntityFlags::Entity entities, CEntityFlags::ReadState state, int number)
|
||||
{
|
||||
Q_UNUSED(number);
|
||||
if (!entities.testFlag(CEntityFlags::SharedInfoObjectEntity) && !entities.testFlag(CEntityFlags::DbInfoObjectEntity) && !CEntityFlags::anySwiftDbEntity(entities)) { return; }
|
||||
if (state == CEntityFlags::ReadFinished || state == CEntityFlags::ReadFinishedRestricted)
|
||||
{
|
||||
this->m_loadInProgress = false;
|
||||
emit this->ps_triggerDigestGuiUpdate();
|
||||
}
|
||||
if (!CEntityFlags::isFinishedReadState(state)) return;
|
||||
if (!entities.testFlag(CEntityFlags::SharedInfoObjectEntity) && entities.testFlag(CEntityFlags::DbInfoObjectEntity) && !CEntityFlags::anySwiftDbEntity(entities)) { return; }
|
||||
this->m_loadInProgress = false;
|
||||
emit this->ps_triggerDigestGuiUpdate();
|
||||
}
|
||||
|
||||
void CDbLoadOverviewComponent::ps_loadInfoObjects()
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace BlackGui
|
||||
//! Refresh directly from DB
|
||||
void ps_refreshDbPressed();
|
||||
|
||||
//! Refresh directly from DB
|
||||
//! Refresh directly from shared files
|
||||
void ps_refreshSharedPressed();
|
||||
|
||||
//! Init the value panel
|
||||
|
||||
@@ -68,6 +68,11 @@ namespace BlackMisc
|
||||
return numberOfEntities(flag) == 1;
|
||||
}
|
||||
|
||||
bool CEntityFlags::isFinishedReadState(CEntityFlags::ReadState state)
|
||||
{
|
||||
return state == ReadFinished || state == ReadFinishedRestricted;
|
||||
}
|
||||
|
||||
int CEntityFlags::numberOfEntities(BlackMisc::Network::CEntityFlags::Entity flag)
|
||||
{
|
||||
const int c = static_cast<int>(std::bitset<(sizeof(flag) * 8)>(flag).count());
|
||||
|
||||
@@ -76,6 +76,9 @@ namespace BlackMisc
|
||||
//! Representing single entity?
|
||||
static bool isSingleEntity(BlackMisc::Network::CEntityFlags::Entity flag);
|
||||
|
||||
//! Any finished state
|
||||
static bool isFinishedReadState(ReadState state);
|
||||
|
||||
//! Represented number of entities
|
||||
static int numberOfEntities(BlackMisc::Network::CEntityFlags::Entity flag);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user