diff --git a/src/blackcore/data/globalsetup.cpp b/src/blackcore/data/globalsetup.cpp index bd4cbc2e9..660246f54 100644 --- a/src/blackcore/data/globalsetup.cpp +++ b/src/blackcore/data/globalsetup.cpp @@ -155,10 +155,10 @@ namespace BlackCore return setup; } - CUrlList CGlobalSetup::getUpdateInfoFileUrls() const + CUrlList CGlobalSetup::getDistributionUrls() const { const CUrlList urls(m_sharedUrls); - return urls.appendPath(CGlobalSetup::versionString() + "/updateinfo/updateinfo.json"); + return urls.appendPath(CGlobalSetup::versionString() + "/updateinfo/distribution.json"); } CUrlList CGlobalSetup::getSwiftDbDataFileLocationUrls() const @@ -194,8 +194,8 @@ namespace BlackCore s.append(boolToYesNo(isDevelopment())); s.append(separator); - s.append("Update info URLs: "); - s.append(getUpdateInfoFileUrls().toQString(i18n)); + s.append("Distribution URLs: "); + s.append(getDistributionUrls().toQString(i18n)); s.append(separator); s.append("Bootstrap URLs: "); s.append(getBootstrapFileUrls().toQString(i18n)); @@ -270,7 +270,7 @@ namespace BlackCore case IndexVatsimMetars: return CVariant::fromValue(this->m_vatsimMetarsUrls); case IndexUpdateInfo: - return CVariant::fromValue(this->getUpdateInfoFileUrls()); + return CVariant::fromValue(this->getDistributionUrls()); case IndexBootstrapFileUrls: return CVariant::fromValue(this->getBootstrapFileUrls()); case IndexSwiftDbFiles: diff --git a/src/blackcore/data/globalsetup.h b/src/blackcore/data/globalsetup.h index 4997aa718..75bf4de0b 100644 --- a/src/blackcore/data/globalsetup.h +++ b/src/blackcore/data/globalsetup.h @@ -132,7 +132,7 @@ namespace BlackCore BlackMisc::Network::CUrlList getBootstrapFileUrls() const; //! Version and download locations - BlackMisc::Network::CUrlList getUpdateInfoFileUrls() const; + BlackMisc::Network::CUrlList getDistributionUrls() const; //! Alternative locations of swift DB data files BlackMisc::Network::CUrlList getSwiftDbDataFileLocationUrls() const; diff --git a/src/blackcore/setupreader.cpp b/src/blackcore/setupreader.cpp index 7848b2498..fbe384dd0 100644 --- a/src/blackcore/setupreader.cpp +++ b/src/blackcore/setupreader.cpp @@ -81,7 +81,7 @@ namespace BlackCore ); if (this->m_bootstrapMode == CacheOnly) { - this->m_updateInfoUrls = cachedSetup.getUpdateInfoFileUrls(); + this->m_distributionUrls = cachedSetup.getDistributionUrls(); msgs.push_back(cacheAvailable ? CStatusMessage(this, CStatusMessage::SeverityInfo, "Cache only setup, using it as it is") : CStatusMessage(this, CStatusMessage::SeverityError, "Cache only setup, but cache is empty") @@ -227,14 +227,12 @@ namespace BlackCore void CSetupReader::ps_readUpdateInfo() { - // const CUrl url(this->m_updateInfoUrls.obtainNextWorkingUrl()); - - const CUrl url("https://datastore.swift-project.org/shared/0.7.0/updateinfo/updateinfo2.json"); + const CUrl url(this->m_distributionUrls.obtainNextWorkingUrl()); if (url.isEmpty()) { CLogMessage(this).warning("Cannot read update info, URLs: %1, failed URLs: %2") - << this->m_updateInfoUrls - << this->m_updateInfoUrls.getFailedUrls(); + << this->m_distributionUrls + << this->m_distributionUrls.getFailedUrls(); this->manageDistributionsInfoAvailability(false); return; } @@ -330,7 +328,7 @@ namespace BlackCore bool sameVersionLoaded = (loadedSetup == currentSetup); if (sameVersionLoaded) { - this->m_updateInfoUrls = currentSetup.getUpdateInfoFileUrls(); // defaults + this->m_distributionUrls = currentSetup.getDistributionUrls(); // defaults CLogMessage(this).info("Same setup version loaded from %1 as already in data cache %2") << urlString << m_setup.getFilename(); CLogMessage::preformatted(this->manageSetupAvailability(true)); return; // success @@ -343,7 +341,7 @@ namespace BlackCore if (m.isSeverityInfoOrLess()) { // no issue with cache - this->m_updateInfoUrls = loadedSetup.getUpdateInfoFileUrls(); + this->m_distributionUrls = loadedSetup.getDistributionUrls(); CLogMessage(this).info("Setup: Updated data cache in '%1'") << this->m_setup.getFilename(); } CLogMessage::preformatted(this->manageSetupAvailability(true)); @@ -457,7 +455,7 @@ namespace BlackCore } // try next one if any - if (this->m_updateInfoUrls.addFailedUrl(url)) + if (this->m_distributionUrls.addFailedUrl(url)) { QTimer::singleShot(500, this, &CSetupReader::ps_readUpdateInfo); } diff --git a/src/blackcore/setupreader.h b/src/blackcore/setupreader.h index f7a30d2cf..6c349de5d 100644 --- a/src/blackcore/setupreader.h +++ b/src/blackcore/setupreader.h @@ -130,15 +130,15 @@ namespace BlackCore bool m_shutdown = false; std::atomic m_setupAvailable { false }; std::atomic m_distributionInfoAvailable { false }; - QString m_localSetupFileValue; //! Local file for setup, passed by cmd line arguments - QString m_bootstrapUrlFileValue; //! Bootstrap URL if not local - BootstrapMode m_bootstrapMode = Explicit; //! How to bootstrap - BlackMisc::Network::CFailoverUrlList m_bootstrapUrls; //!< location of setup files - BlackMisc::Network::CFailoverUrlList m_updateInfoUrls; //!< location of info files - QCommandLineOption m_cmdBootstrapUrl; //!< bootstrap URL - QCommandLineOption m_cmdBootstrapMode; //!< bootstrap mode - mutable QReadWriteLock m_lockSetup; //!< lock for setup - BlackMisc::CStatusMessageList m_setupReadErrorMsgs; //!< last parsing error messages + QString m_localSetupFileValue; //! Local file for setup, passed by cmd line arguments + QString m_bootstrapUrlFileValue; //! Bootstrap URL if not local + BootstrapMode m_bootstrapMode = Explicit; //! How to bootstrap + BlackMisc::Network::CFailoverUrlList m_bootstrapUrls; //!< location of setup files + BlackMisc::Network::CFailoverUrlList m_distributionUrls; //!< location of info files + QCommandLineOption m_cmdBootstrapUrl; //!< bootstrap URL + QCommandLineOption m_cmdBootstrapMode; //!< bootstrap mode + mutable QReadWriteLock m_lockSetup; //!< lock for setup + BlackMisc::CStatusMessageList m_setupReadErrorMsgs; //!< last parsing error messages BlackMisc::CData m_setup {this, &CSetupReader::ps_setupChanged}; //!< data cache setup BlackMisc::CData m_distributions {this}; //!< data cache distributions