diff --git a/src/blackcore/webdataservices.cpp b/src/blackcore/webdataservices.cpp index 0554144ab..4b6e9080c 100644 --- a/src/blackcore/webdataservices.cpp +++ b/src/blackcore/webdataservices.cpp @@ -177,12 +177,6 @@ namespace BlackCore return false; } - bool CWebDataServices::canConnectSwiftDb(bool strict) const - { - if (!strict && this->hasConnectedSwiftDb()) { return true; } - return CNetworkUtils::canConnect(sApp->getGlobalSetup().getDbHomePageUrl()); - } - void CWebDataServices::resetSignalFlags() { m_signalledEntities.clear(); @@ -787,11 +781,6 @@ namespace BlackCore if (m_databaseWriter) { m_databaseWriter->gracefulShutdown(); } } - CUrl CWebDataServices::getDbReaderCurrentSharedDbDataUrl() const - { - return CDatabaseReader::getCurrentSharedDbDataUrl(); - } - CEntityFlags::Entity CWebDataServices::allDbEntitiesForUsedReaders() const { // obtain entities from real readers (means when reader is really used) @@ -834,7 +823,7 @@ namespace BlackCore // 1a. If any DB data, read the info objects upfront if (needsDbInfoObjects) { - const bool databaseUp = CInfoDataReader::canPingSwiftServer(); + const bool databaseUp = sApp->isSwiftDbAccessible(); if (!databaseUp) { dbReaderConfig.markAsDbDown(); } if (anyDbEntities && readersNeeded.testFlag(CWebReaderFlags::WebReaderFlag::DbInfoDataReader)) @@ -919,6 +908,8 @@ namespace BlackCore Q_ASSERT_X(c, Q_FUNC_INFO, "Cannot connect ICAO reader signals"); c = connect(m_icaoDataReader, &CIcaoDataReader::dataRead, this, &CWebDataServices::dataRead); Q_ASSERT_X(c, Q_FUNC_INFO, "Cannot connect ICAO reader signals"); + c = connect(m_icaoDataReader, &CIcaoDataReader::swiftDbDataRead, this, &CWebDataServices::swiftDbDataRead); + Q_ASSERT_X(c, Q_FUNC_INFO, "Cannot connect Model reader signals"); m_icaoDataReader->start(QThread::LowPriority); } @@ -930,6 +921,8 @@ namespace BlackCore Q_ASSERT_X(c, Q_FUNC_INFO, "Cannot connect Model reader signals"); c = connect(m_modelDataReader, &CModelDataReader::dataRead, this, &CWebDataServices::dataRead); Q_ASSERT_X(c, Q_FUNC_INFO, "Cannot connect Model reader signals"); + c = connect(m_modelDataReader, &CModelDataReader::swiftDbDataRead, this, &CWebDataServices::swiftDbDataRead); + Q_ASSERT_X(c, Q_FUNC_INFO, "Cannot connect Model reader signals"); m_modelDataReader->start(QThread::LowPriority); } @@ -941,6 +934,8 @@ namespace BlackCore Q_ASSERT_X(c, Q_FUNC_INFO, "Cannot connect Model reader signals"); c = connect(m_airportDataReader, &CAirportDataReader::dataRead, this, &CWebDataServices::dataRead); Q_ASSERT_X(c, Q_FUNC_INFO, "Cannot connect Model reader signals"); + c = connect(m_airportDataReader, &CAirportDataReader::swiftDbDataRead, this, &CWebDataServices::swiftDbDataRead); + Q_ASSERT_X(c, Q_FUNC_INFO, "Cannot connect Model reader signals"); m_airportDataReader->start(QThread::LowPriority); } Q_UNUSED(c); // signal connect flag diff --git a/src/blackcore/webdataservices.h b/src/blackcore/webdataservices.h index dcbe5f26a..b89812dca 100644 --- a/src/blackcore/webdataservices.h +++ b/src/blackcore/webdataservices.h @@ -119,9 +119,6 @@ namespace BlackCore //! Reader flags CWebReaderFlags::WebReader getReaderFlags() const { return m_readers; } - //! Currently used URL for shared DB data - BlackMisc::Network::CUrl getDbReaderCurrentSharedDbDataUrl() const; - //! All DB entities for those readers used and not ignored BlackMisc::Network::CEntityFlags::Entity allDbEntitiesForUsedReaders() const; @@ -404,9 +401,6 @@ namespace BlackCore //! Has already connect swift DB? bool hasConnectedSwiftDb() const; - //! Can connect swift DB? - bool canConnectSwiftDb(bool strict = false) const; - //! Reset the flags what was already signaled void resetSignalFlags(); @@ -426,6 +420,9 @@ namespace BlackCore //! Combined read signal void dataRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState state, int number); + //! DB data read + void swiftDbDataRead(bool success); + // simplified signals follow // 1) simple signature // 2) fired directly after read, no need to wait for other entities