diff --git a/src/blackgui/components/dbloadoverviewcomponent.cpp b/src/blackgui/components/dbloadoverviewcomponent.cpp index 8cfc3934c..837d0f5b7 100644 --- a/src/blackgui/components/dbloadoverviewcomponent.cpp +++ b/src/blackgui/components/dbloadoverviewcomponent.cpp @@ -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); } diff --git a/src/blackgui/components/infobarwebreadersstatuscomponent.cpp b/src/blackgui/components/infobarwebreadersstatuscomponent.cpp index d8a2c97bb..b08312f1b 100644 --- a/src/blackgui/components/infobarwebreadersstatuscomponent.cpp +++ b/src/blackgui/components/infobarwebreadersstatuscomponent.cpp @@ -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);