mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 15:25:35 +08:00
refs #921, avoid issue when called during shutdown
This commit is contained in:
committed by
Mathew Sutcliffe
parent
d4fbf8b49c
commit
9eb67edddf
@@ -28,7 +28,6 @@ namespace BlackGui
|
||||
ui(new Ui::CDbLoadOverviewComponent)
|
||||
{
|
||||
Q_ASSERT_X(sGui, Q_FUNC_INFO, "missing sGui");
|
||||
Q_ASSERT_X(sGui->getWebDataServices(), Q_FUNC_INFO, "no data services");
|
||||
|
||||
ui->setupUi(this);
|
||||
this->admitCaches(); // in background
|
||||
@@ -59,8 +58,11 @@ namespace BlackGui
|
||||
connect(ui->pb_LoadAllFromDB, &QPushButton::pressed, this, &CDbLoadOverviewComponent::loadAllFromDb);
|
||||
connect(ui->pb_LoadAllFromShared, &QPushButton::pressed, this, &CDbLoadOverviewComponent::loadAllFromShared);
|
||||
|
||||
connect(sGui->getWebDataServices(), &CWebDataServices::dataRead, this, &CDbLoadOverviewComponent::ps_dataLoaded);
|
||||
connect(this, &CDbLoadOverviewComponent::ps_triggerDigestGuiUpdate, this, &CDbLoadOverviewComponent::ps_setValues);
|
||||
if (sGui->hasWebDataServices())
|
||||
{
|
||||
connect(sGui->getWebDataServices(), &CWebDataServices::dataRead, this, &CDbLoadOverviewComponent::ps_dataLoaded);
|
||||
}
|
||||
}
|
||||
|
||||
CDbLoadOverviewComponent::~CDbLoadOverviewComponent()
|
||||
@@ -241,6 +243,7 @@ namespace BlackGui
|
||||
|
||||
void CDbLoadOverviewComponent::admitCaches()
|
||||
{
|
||||
if (!sGui->hasWebDataServices()) { return; }
|
||||
sGui->getWebDataServices()->admitDbCaches(CEntityFlags::AllDbEntities);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,15 +30,21 @@ namespace BlackGui
|
||||
void CInfoBarWebReadersStatusBase::init()
|
||||
{
|
||||
Q_ASSERT_X(sGui, Q_FUNC_INFO, "No sGui");
|
||||
Q_ASSERT_X(sGui->hasWebDataServices(), Q_FUNC_INFO, "No web data services");
|
||||
this->initLeds();
|
||||
bool c = connect(&m_timer, &QTimer::timeout, this, &CInfoBarWebReadersStatusBase::ps_checkServerAndData);
|
||||
Q_ASSERT_X(c, Q_FUNC_INFO, "Failed connect");
|
||||
|
||||
// connect timer
|
||||
m_timer.setInterval(30 * 1000);
|
||||
m_timer.start();
|
||||
m_timer.setObjectName("CInfoBarWebReadersStatusBase::CheckSwiftDbTimer");
|
||||
c = connect(sGui->getWebDataServices(), &CWebDataServices::dataRead, this, &CInfoBarWebReadersStatusBase::ps_dataRead);
|
||||
bool c = connect(&m_timer, &QTimer::timeout, this, &CInfoBarWebReadersStatusBase::ps_checkServerAndData);
|
||||
Q_ASSERT_X(c, Q_FUNC_INFO, "Failed connect");
|
||||
|
||||
if (sGui->hasWebDataServices())
|
||||
{
|
||||
c = connect(sGui->getWebDataServices(), &CWebDataServices::dataRead, this, &CInfoBarWebReadersStatusBase::ps_dataRead);
|
||||
Q_ASSERT_X(c, Q_FUNC_INFO, "Failed connect");
|
||||
}
|
||||
|
||||
Q_UNUSED(c);
|
||||
}
|
||||
|
||||
@@ -70,8 +76,9 @@ namespace BlackGui
|
||||
|
||||
void CInfoBarWebReadersStatusBase::ps_checkServerAndData()
|
||||
{
|
||||
bool swift =
|
||||
const bool swift =
|
||||
sGui &&
|
||||
sGui->hasWebDataServices() &&
|
||||
sGui->getWebDataServices()->canConnectSwiftDb();
|
||||
this->led_SwiftDb->setOn(swift);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user