mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 04:25:35 +08:00
Added "url" to signature "dataRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState state, int number, const QUrl &url)"
Allows to write log. messages with URL
This commit is contained in:
committed by
Mat Sutcliffe
parent
f840244bdb
commit
5b3c011a15
@@ -100,6 +100,7 @@ namespace BlackCore
|
||||
}
|
||||
else
|
||||
{
|
||||
const QUrl url = QUrl::fromLocalFile(fi.absoluteFilePath());
|
||||
const QJsonObject airportsJson(CDatabaseUtils::readQJsonObjectFromDatabaseFile(fileName));
|
||||
if (!airportsJson.isEmpty())
|
||||
{
|
||||
@@ -109,12 +110,12 @@ namespace BlackCore
|
||||
c = airports.size();
|
||||
msgs.push_back(m_airportCache.set(airports, fi.birthTime().toUTC().toMSecsSinceEpoch()));
|
||||
|
||||
emit dataRead(CEntityFlags::AirportEntity, CEntityFlags::ReadFinished, c);
|
||||
emit dataRead(CEntityFlags::AirportEntity, CEntityFlags::ReadFinished, c, url);
|
||||
reallyRead |= CEntityFlags::AirportEntity;
|
||||
}
|
||||
catch (const CJsonException &ex)
|
||||
{
|
||||
emit dataRead(CEntityFlags::AirportEntity, CEntityFlags::ReadFailed, 0);
|
||||
emit dataRead(CEntityFlags::AirportEntity, CEntityFlags::ReadFailed, 0, url);
|
||||
return ex.toStatusMessage(this, QStringLiteral("Reading airports from '%1'").arg(fileName));
|
||||
}
|
||||
}
|
||||
@@ -168,7 +169,7 @@ namespace BlackCore
|
||||
|
||||
bool CAirportDataReader::hasChangedUrl(CEntityFlags::Entity entity, CUrl &oldUrlInfo, CUrl &newUrlInfo) const
|
||||
{
|
||||
Q_UNUSED(entity);
|
||||
Q_UNUSED(entity)
|
||||
oldUrlInfo = m_readerUrlCache.get();
|
||||
newUrlInfo = this->getBaseUrl(CDbFlags::DbReading);
|
||||
return CDatabaseReader::isChangedUrl(oldUrlInfo, newUrlInfo);
|
||||
@@ -192,15 +193,17 @@ namespace BlackCore
|
||||
if (!this->doWorkCheck()) { return; }
|
||||
|
||||
const CDatabaseReader::JsonDatastoreResponse res = this->setStatusAndTransformReplyIntoDatastoreResponse(nwReplyPtr);
|
||||
const QUrl url = nwReply->url();
|
||||
|
||||
if (res.hasErrorMessage())
|
||||
{
|
||||
CLogMessage::preformatted(res.lastWarningOrAbove());
|
||||
emit this->dataRead(CEntityFlags::AirportEntity, CEntityFlags::ReadFailed, 0);
|
||||
emit this->dataRead(CEntityFlags::AirportEntity, CEntityFlags::ReadFailed, 0, url);
|
||||
return;
|
||||
}
|
||||
|
||||
// parsing
|
||||
emit this->dataRead(CEntityFlags::AircraftIcaoEntity, CEntityFlags::ReadParsing, 0);
|
||||
emit this->dataRead(CEntityFlags::AircraftIcaoEntity, CEntityFlags::ReadParsing, 0, url);
|
||||
CAirportList airports;
|
||||
CAirportList inconsistent;
|
||||
if (res.isRestricted())
|
||||
@@ -215,7 +218,7 @@ namespace BlackCore
|
||||
QElapsedTimer time;
|
||||
time.start();
|
||||
airports = CAirportList::fromDatabaseJson(res, &inconsistent);
|
||||
this->logParseMessage("airports", airports.size(), time.elapsed(), res);
|
||||
this->logParseMessage("airports", airports.size(), static_cast<int>(time.elapsed()), res);
|
||||
}
|
||||
|
||||
if (!inconsistent.isEmpty())
|
||||
@@ -247,7 +250,7 @@ namespace BlackCore
|
||||
entity &= CEntityFlags::AirportEntity;
|
||||
if (!this->isInternetAccessible())
|
||||
{
|
||||
emit this->dataRead(entity, CEntityFlags::ReadSkipped, 0);
|
||||
emit this->dataRead(entity, CEntityFlags::ReadSkipped, 0, {});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -258,7 +261,7 @@ namespace BlackCore
|
||||
{
|
||||
url.appendQuery(queryLatestTimestamp(newerThan));
|
||||
this->getFromNetworkAndLog(url, { this, &CAirportDataReader::parseAirportData });
|
||||
emit dataRead(CEntityFlags::AirportEntity, CEntityFlags::ReadStarted, 0);
|
||||
emit dataRead(CEntityFlags::AirportEntity, CEntityFlags::ReadStarted, 0, url);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -206,7 +206,7 @@ namespace BlackCore
|
||||
{
|
||||
if (!myself) { return; }
|
||||
if (!sApp || sApp->isShuttingDown()) { return; }
|
||||
emit this->dataRead(validInCacheEntities, CEntityFlags::ReadFinished, 0);
|
||||
emit this->dataRead(validInCacheEntities, CEntityFlags::ReadFinished, 0, {});
|
||||
});
|
||||
}
|
||||
if (newerHeaderEntities == CEntityFlags::NoEntity) { return CEntityFlags::NoEntity; }
|
||||
@@ -490,7 +490,7 @@ namespace BlackCore
|
||||
const int c = this->getCacheCount(currentCachedEntity);
|
||||
if (!onlyIfHasData || c > 0)
|
||||
{
|
||||
emit this->dataRead(currentCachedEntity, CEntityFlags::ReadFinished, c);
|
||||
emit this->dataRead(currentCachedEntity, CEntityFlags::ReadFinished, c, {});
|
||||
emitted |= currentCachedEntity;
|
||||
}
|
||||
currentCachedEntity = CEntityFlags::iterateDbEntities(cachedEntitiesToEmit);
|
||||
@@ -503,7 +503,7 @@ namespace BlackCore
|
||||
// never emit when lock is held, deadlock
|
||||
Q_ASSERT_X(CEntityFlags::isSingleEntity(entity), Q_FUNC_INFO, "Expect single entity");
|
||||
CLogMessage(this).info(u"Read %1 entities of '%2' from '%3' (%4)") << number << CEntityFlags::flagToString(entity) << res.getUrlString() << res.getLoadTimeStringWithStartedHint();
|
||||
emit this->dataRead(entity, res.isRestricted() ? CEntityFlags::ReadFinishedRestricted : CEntityFlags::ReadFinished, number);
|
||||
emit this->dataRead(entity, res.isRestricted() ? CEntityFlags::ReadFinishedRestricted : CEntityFlags::ReadFinished, number, res.getUrl());
|
||||
}
|
||||
|
||||
void CDatabaseReader::logNoWorkingUrl(CEntityFlags::Entity entity)
|
||||
|
||||
@@ -295,7 +295,7 @@ namespace BlackCore
|
||||
|
||||
//! Combined read signal
|
||||
//! \remark normally in success case state for a single case, skipped cases can be reported for 1..n enities
|
||||
void dataRead(BlackMisc::Network::CEntityFlags::Entity entities, BlackMisc::Network::CEntityFlags::ReadState state, int number);
|
||||
void dataRead(BlackMisc::Network::CEntityFlags::Entity entities, BlackMisc::Network::CEntityFlags::ReadState state, int number, const QUrl &url);
|
||||
|
||||
//! Header of shared file read
|
||||
void sharedFileHeaderRead(BlackMisc::Network::CEntityFlags::Entity entity, const QString &fileName, bool success);
|
||||
|
||||
@@ -178,16 +178,18 @@ namespace BlackCore
|
||||
this->threadAssertCheck(); // runs in background thread
|
||||
if (!this->doWorkCheck()) { return; }
|
||||
entities &= CEntityFlags::AllIcaoCountriesCategory;
|
||||
|
||||
if (!this->isInternetAccessible())
|
||||
{
|
||||
emit this->dataRead(entities, CEntityFlags::ReadSkipped, 0);
|
||||
emit this->dataRead(entities, CEntityFlags::ReadSkipped, 0, {});
|
||||
return;
|
||||
}
|
||||
|
||||
CEntityFlags::Entity entitiesTriggered = CEntityFlags::NoEntity;
|
||||
CUrl url;
|
||||
if (entities.testFlag(CEntityFlags::AircraftIcaoEntity))
|
||||
{
|
||||
CUrl url(this->getAircraftIcaoUrl(mode));
|
||||
url = this->getAircraftIcaoUrl(mode);
|
||||
if (!url.isEmpty())
|
||||
{
|
||||
url.appendQuery(queryLatestTimestamp(newerThan));
|
||||
@@ -202,7 +204,7 @@ namespace BlackCore
|
||||
|
||||
if (entities.testFlag(CEntityFlags::AirlineIcaoEntity))
|
||||
{
|
||||
CUrl url(this->getAirlineIcaoUrl(mode));
|
||||
url = this->getAirlineIcaoUrl(mode);
|
||||
if (!url.isEmpty())
|
||||
{
|
||||
url.appendQuery(queryLatestTimestamp(newerThan));
|
||||
@@ -217,7 +219,7 @@ namespace BlackCore
|
||||
|
||||
if (entities.testFlag(CEntityFlags::CountryEntity))
|
||||
{
|
||||
CUrl url(this->getCountryUrl(mode));
|
||||
url = this->getCountryUrl(mode);
|
||||
if (!url.isEmpty())
|
||||
{
|
||||
url.appendQuery(queryLatestTimestamp(newerThan));
|
||||
@@ -232,7 +234,7 @@ namespace BlackCore
|
||||
|
||||
if (entities.testFlag(CEntityFlags::AircraftCategoryEntity))
|
||||
{
|
||||
CUrl url(this->getAircraftCategoryUrl(mode));
|
||||
url = this->getAircraftCategoryUrl(mode);
|
||||
if (!url.isEmpty())
|
||||
{
|
||||
url.appendQuery(queryLatestTimestamp(newerThan));
|
||||
@@ -247,7 +249,7 @@ namespace BlackCore
|
||||
|
||||
if (entitiesTriggered != CEntityFlags::NoEntity)
|
||||
{
|
||||
emit this->dataRead(entitiesTriggered, CEntityFlags::ReadStarted, 0);
|
||||
emit this->dataRead(entitiesTriggered, CEntityFlags::ReadStarted, 0, url);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,14 +297,16 @@ namespace BlackCore
|
||||
if (!this->doWorkCheck()) { return; }
|
||||
|
||||
const CDatabaseReader::JsonDatastoreResponse res = this->setStatusAndTransformReplyIntoDatastoreResponse(nwReply.data());
|
||||
const QUrl url = nwReply->url();
|
||||
|
||||
if (res.hasErrorMessage())
|
||||
{
|
||||
CLogMessage::preformatted(res.lastWarningOrAbove());
|
||||
emit this->dataRead(CEntityFlags::AircraftIcaoEntity, CEntityFlags::ReadFailed, 0);
|
||||
emit this->dataRead(CEntityFlags::AircraftIcaoEntity, CEntityFlags::ReadFailed, 0, url);
|
||||
return;
|
||||
}
|
||||
|
||||
emit this->dataRead(CEntityFlags::AircraftIcaoEntity, CEntityFlags::ReadParsing, 0);
|
||||
emit this->dataRead(CEntityFlags::AircraftIcaoEntity, CEntityFlags::ReadParsing, 0, url);
|
||||
CAircraftIcaoCodeList codes;
|
||||
CAircraftIcaoCodeList inconsistent;
|
||||
const CAircraftCategoryList categories = this->getAircraftCategories();
|
||||
@@ -320,7 +324,7 @@ namespace BlackCore
|
||||
QElapsedTimer time;
|
||||
time.start();
|
||||
codes = CAircraftIcaoCodeList::fromDatabaseJson(res, categories, true, &inconsistent);
|
||||
this->logParseMessage("aircraft ICAO", codes.size(), time.elapsed(), res);
|
||||
this->logParseMessage("aircraft ICAO", codes.size(), static_cast<int>(time.elapsed()), res);
|
||||
}
|
||||
|
||||
if (!inconsistent.isEmpty())
|
||||
@@ -350,15 +354,16 @@ namespace BlackCore
|
||||
QScopedPointer<QNetworkReply, QScopedPointerDeleteLater> nwReply(nwReplyPtr);
|
||||
if (!this->doWorkCheck()) { return; }
|
||||
|
||||
const QUrl url = nwReply->url();
|
||||
const CDatabaseReader::JsonDatastoreResponse res = this->setStatusAndTransformReplyIntoDatastoreResponse(nwReply.data());
|
||||
if (res.hasErrorMessage())
|
||||
{
|
||||
CLogMessage::preformatted(res.lastWarningOrAbove());
|
||||
emit this->dataRead(CEntityFlags::AirlineIcaoEntity, CEntityFlags::ReadFailed, 0);
|
||||
emit this->dataRead(CEntityFlags::AirlineIcaoEntity, CEntityFlags::ReadFailed, 0, url);
|
||||
return;
|
||||
}
|
||||
|
||||
emit this->dataRead(CEntityFlags::AirlineIcaoEntity, CEntityFlags::ReadParsing, 0);
|
||||
emit this->dataRead(CEntityFlags::AirlineIcaoEntity, CEntityFlags::ReadParsing, 0, url);
|
||||
CAirlineIcaoCodeList codes;
|
||||
CAirlineIcaoCodeList inconsistent;
|
||||
if (res.isRestricted())
|
||||
@@ -375,7 +380,7 @@ namespace BlackCore
|
||||
QElapsedTimer time;
|
||||
time.start();
|
||||
codes = CAirlineIcaoCodeList::fromDatabaseJson(res, true, &inconsistent);
|
||||
this->logParseMessage("airline ICAO", codes.size(), time.elapsed(), res);
|
||||
this->logParseMessage("airline ICAO", codes.size(), static_cast<int>(time.elapsed()), res);
|
||||
}
|
||||
|
||||
if (!inconsistent.isEmpty())
|
||||
@@ -404,14 +409,16 @@ namespace BlackCore
|
||||
{
|
||||
QScopedPointer<QNetworkReply, QScopedPointerDeleteLater> nwReply(nwReplyPtr);
|
||||
const CDatabaseReader::JsonDatastoreResponse res = this->setStatusAndTransformReplyIntoDatastoreResponse(nwReply.data());
|
||||
const QUrl url = nwReply->url();
|
||||
|
||||
if (res.hasErrorMessage())
|
||||
{
|
||||
CLogMessage::preformatted(res.lastWarningOrAbove());
|
||||
emit this->dataRead(CEntityFlags::CountryEntity, CEntityFlags::ReadFailed, 0);
|
||||
emit this->dataRead(CEntityFlags::CountryEntity, CEntityFlags::ReadFailed, 0, url);
|
||||
return;
|
||||
}
|
||||
|
||||
emit this->dataRead(CEntityFlags::CountryEntity, CEntityFlags::ReadParsing, 0);
|
||||
emit this->dataRead(CEntityFlags::CountryEntity, CEntityFlags::ReadParsing, 0, url);
|
||||
CCountryList countries;
|
||||
if (res.isRestricted())
|
||||
{
|
||||
@@ -427,7 +434,7 @@ namespace BlackCore
|
||||
QElapsedTimer time;
|
||||
time.start();
|
||||
countries = CCountryList::fromDatabaseJson(res);
|
||||
this->logParseMessage("countries", countries.size(), time.elapsed(), res);
|
||||
this->logParseMessage("countries", countries.size(), static_cast<int>(time.elapsed()), res);
|
||||
}
|
||||
|
||||
if (!this->doWorkCheck()) { return; }
|
||||
@@ -449,14 +456,16 @@ namespace BlackCore
|
||||
{
|
||||
QScopedPointer<QNetworkReply, QScopedPointerDeleteLater> nwReply(nwReplyPtr);
|
||||
const CDatabaseReader::JsonDatastoreResponse res = this->setStatusAndTransformReplyIntoDatastoreResponse(nwReply.data());
|
||||
const QUrl url = nwReply->url();
|
||||
|
||||
if (res.hasErrorMessage())
|
||||
{
|
||||
CLogMessage::preformatted(res.lastWarningOrAbove());
|
||||
emit this->dataRead(CEntityFlags::AircraftCategoryEntity, CEntityFlags::ReadFailed, 0);
|
||||
emit this->dataRead(CEntityFlags::AircraftCategoryEntity, CEntityFlags::ReadFailed, 0, url);
|
||||
return;
|
||||
}
|
||||
|
||||
emit this->dataRead(CEntityFlags::AircraftCategoryEntity, CEntityFlags::ReadParsing, 0);
|
||||
emit this->dataRead(CEntityFlags::AircraftCategoryEntity, CEntityFlags::ReadParsing, 0, url);
|
||||
CAircraftCategoryList categories;
|
||||
if (res.isRestricted())
|
||||
{
|
||||
@@ -472,7 +481,7 @@ namespace BlackCore
|
||||
QElapsedTimer time;
|
||||
time.start();
|
||||
categories = CAircraftCategoryList::fromDatabaseJson(res);
|
||||
this->logParseMessage("categories", categories.size(), time.elapsed(), res);
|
||||
this->logParseMessage("categories", categories.size(), static_cast<int>(time.elapsed()), res);
|
||||
}
|
||||
|
||||
if (!this->doWorkCheck()) { return; }
|
||||
@@ -516,6 +525,7 @@ namespace BlackCore
|
||||
}
|
||||
else
|
||||
{
|
||||
const QUrl url = QUrl::fromLocalFile(fi.absoluteFilePath());
|
||||
const QJsonObject countriesJson(CDatabaseUtils::readQJsonObjectFromDatabaseFile(fileName));
|
||||
if (countriesJson.isEmpty())
|
||||
{
|
||||
@@ -529,11 +539,11 @@ namespace BlackCore
|
||||
const int c = countries.size();
|
||||
msgs.push_back(m_countryCache.set(countries, fi.birthTime().toUTC().toMSecsSinceEpoch()));
|
||||
reallyRead |= CEntityFlags::CountryEntity;
|
||||
emit this->dataRead(CEntityFlags::CountryEntity, CEntityFlags::ReadFinished, c);
|
||||
emit this->dataRead(CEntityFlags::CountryEntity, CEntityFlags::ReadFinished, c, url);
|
||||
}
|
||||
catch (const CJsonException &ex)
|
||||
{
|
||||
emit this->dataRead(CEntityFlags::CountryEntity, CEntityFlags::ReadFailed, 0);
|
||||
emit this->dataRead(CEntityFlags::CountryEntity, CEntityFlags::ReadFailed, 0, url);
|
||||
msgs.push_back(ex.toStatusMessage(this, QStringLiteral("Reading countries from '%1'").arg(fileName)));
|
||||
}
|
||||
}
|
||||
@@ -554,6 +564,7 @@ namespace BlackCore
|
||||
}
|
||||
else
|
||||
{
|
||||
const QUrl url = QUrl::fromLocalFile(fi.absoluteFilePath());
|
||||
const QJsonObject aircraftJson(CDatabaseUtils::readQJsonObjectFromDatabaseFile(fileName));
|
||||
if (aircraftJson.isEmpty())
|
||||
{
|
||||
@@ -567,11 +578,11 @@ namespace BlackCore
|
||||
const int c = aircraftIcaos.size();
|
||||
msgs.push_back(m_aircraftIcaoCache.set(aircraftIcaos, fi.birthTime().toUTC().toMSecsSinceEpoch()));
|
||||
reallyRead |= CEntityFlags::AircraftIcaoEntity;
|
||||
emit this->dataRead(CEntityFlags::AircraftIcaoEntity, CEntityFlags::ReadFinished, c);
|
||||
emit this->dataRead(CEntityFlags::AircraftIcaoEntity, CEntityFlags::ReadFinished, c, url);
|
||||
}
|
||||
catch (const CJsonException &ex)
|
||||
{
|
||||
emit this->dataRead(CEntityFlags::AircraftIcaoEntity, CEntityFlags::ReadFailed, 0);
|
||||
emit this->dataRead(CEntityFlags::AircraftIcaoEntity, CEntityFlags::ReadFailed, 0, url);
|
||||
msgs.push_back(ex.toStatusMessage(this, QStringLiteral("Reading aircraft ICAOs from '%1'").arg(fileName)));
|
||||
}
|
||||
}
|
||||
@@ -592,6 +603,7 @@ namespace BlackCore
|
||||
}
|
||||
else
|
||||
{
|
||||
const QUrl url = QUrl::fromLocalFile(fi.absoluteFilePath());
|
||||
const QJsonObject airlineJson(CDatabaseUtils::readQJsonObjectFromDatabaseFile(fileName));
|
||||
if (airlineJson.isEmpty())
|
||||
{
|
||||
@@ -605,11 +617,11 @@ namespace BlackCore
|
||||
const int c = airlineIcaos.size();
|
||||
msgs.push_back(m_airlineIcaoCache.set(airlineIcaos, fi.birthTime().toUTC().toMSecsSinceEpoch()));
|
||||
reallyRead |= CEntityFlags::AirlineIcaoEntity;
|
||||
emit this->dataRead(CEntityFlags::AirlineIcaoEntity, CEntityFlags::ReadFinished, c);
|
||||
emit this->dataRead(CEntityFlags::AirlineIcaoEntity, CEntityFlags::ReadFinished, c, url);
|
||||
}
|
||||
catch (const CJsonException &ex)
|
||||
{
|
||||
emit this->dataRead(CEntityFlags::AirlineIcaoEntity, CEntityFlags::ReadFailed, 0);
|
||||
emit this->dataRead(CEntityFlags::AirlineIcaoEntity, CEntityFlags::ReadFailed, 0, url);
|
||||
msgs.push_back(ex.toStatusMessage(this, QStringLiteral("Reading airline ICAOs from '%1'").arg(fileName)));
|
||||
}
|
||||
}
|
||||
@@ -630,6 +642,7 @@ namespace BlackCore
|
||||
}
|
||||
else
|
||||
{
|
||||
const QUrl url = QUrl::fromLocalFile(fi.absoluteFilePath());
|
||||
const QJsonObject aircraftCategory(CDatabaseUtils::readQJsonObjectFromDatabaseFile(fileName));
|
||||
if (aircraftCategory.isEmpty())
|
||||
{
|
||||
@@ -643,11 +656,11 @@ namespace BlackCore
|
||||
const int c = aircraftCategories.size();
|
||||
msgs.push_back(m_categoryCache.set(aircraftCategories, fi.birthTime().toUTC().toMSecsSinceEpoch()));
|
||||
reallyRead |= CEntityFlags::AircraftCategoryEntity;
|
||||
emit this->dataRead(CEntityFlags::AircraftCategoryEntity, CEntityFlags::ReadFinished, c);
|
||||
emit this->dataRead(CEntityFlags::AircraftCategoryEntity, CEntityFlags::ReadFinished, c, url);
|
||||
}
|
||||
catch (const CJsonException &ex)
|
||||
{
|
||||
emit this->dataRead(CEntityFlags::AircraftCategoryEntity, CEntityFlags::ReadFailed, 0);
|
||||
emit this->dataRead(CEntityFlags::AircraftCategoryEntity, CEntityFlags::ReadFailed, 0, url);
|
||||
msgs.push_back(ex.toStatusMessage(this, QStringLiteral("Reading categories from '%1'").arg(fileName)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace BlackCore
|
||||
if (!url.isEmpty())
|
||||
{
|
||||
this->getFromNetworkAndLog(url, { this, &CInfoDataReader::parseInfoObjectsData});
|
||||
emit this->dataRead(this->getEntityForMode(), CEntityFlags::ReadStarted, 0);
|
||||
emit this->dataRead(this->getEntityForMode(), CEntityFlags::ReadStarted, 0, url);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -170,7 +170,7 @@ namespace BlackCore
|
||||
if (res.hasErrorMessage())
|
||||
{
|
||||
CLogMessage::preformatted(res.lastWarningOrAbove());
|
||||
emit this->dataRead(this->getEntityForMode(), CEntityFlags::ReadFailed, 0);
|
||||
emit this->dataRead(this->getEntityForMode(), CEntityFlags::ReadFailed, 0, res.getUrl());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ namespace BlackCore
|
||||
// Service URL => DB data
|
||||
// DB data directory => shared files
|
||||
const QString urlStr = nwReply->url().toString();
|
||||
Q_UNUSED(urlStr); // debug only
|
||||
Q_UNUSED(urlStr) // debug only
|
||||
|
||||
// this part needs to be synchronized
|
||||
{
|
||||
@@ -212,9 +212,9 @@ namespace BlackCore
|
||||
|
||||
void CInfoDataReader::read(CEntityFlags::Entity entities, CDbFlags::DataRetrievalModeFlag mode, const QDateTime &newerThan)
|
||||
{
|
||||
Q_UNUSED(entities);
|
||||
Q_UNUSED(mode);
|
||||
Q_UNUSED(newerThan);
|
||||
Q_UNUSED(entities)
|
||||
Q_UNUSED(mode)
|
||||
Q_UNUSED(newerThan)
|
||||
Q_ASSERT_X(false, Q_FUNC_INFO, "Not implemented for CInfoDataReader");
|
||||
}
|
||||
|
||||
@@ -231,9 +231,9 @@ namespace BlackCore
|
||||
|
||||
CStatusMessageList CInfoDataReader::readFromJsonFiles(const QString &dir, CEntityFlags::Entity whatToRead, bool overrideNewer)
|
||||
{
|
||||
Q_UNUSED(dir);
|
||||
Q_UNUSED(whatToRead);
|
||||
Q_UNUSED(overrideNewer);
|
||||
Q_UNUSED(dir)
|
||||
Q_UNUSED(whatToRead)
|
||||
Q_UNUSED(overrideNewer)
|
||||
Q_ASSERT_X(false, Q_FUNC_INFO, "Not supported");
|
||||
|
||||
return CStatusMessage(this).error(u"Not supported");
|
||||
@@ -241,8 +241,8 @@ namespace BlackCore
|
||||
|
||||
bool CInfoDataReader::readFromJsonFilesInBackground(const QString &dir, CEntityFlags::Entity whatToRead, bool overrideNewer)
|
||||
{
|
||||
Q_UNUSED(dir);
|
||||
Q_UNUSED(whatToRead);
|
||||
Q_UNUSED(dir)
|
||||
Q_UNUSED(whatToRead)
|
||||
Q_UNUSED(overrideNewer)
|
||||
Q_ASSERT_X(false, Q_FUNC_INFO, "Not supported");
|
||||
return false;
|
||||
|
||||
@@ -192,14 +192,16 @@ namespace BlackCore
|
||||
entities &= CEntityFlags::DistributorLiveryModel;
|
||||
if (!this->isInternetAccessible())
|
||||
{
|
||||
emit this->dataRead(entities, CEntityFlags::ReadSkipped, 0);
|
||||
emit this->dataRead(entities, CEntityFlags::ReadSkipped, 0, {});
|
||||
return;
|
||||
}
|
||||
|
||||
CEntityFlags::Entity triggeredRead = CEntityFlags::NoEntity;
|
||||
CUrl url;
|
||||
|
||||
if (entities.testFlag(CEntityFlags::LiveryEntity))
|
||||
{
|
||||
CUrl url(getLiveryUrl(mode));
|
||||
url = this->getLiveryUrl(mode);
|
||||
if (!url.isEmpty())
|
||||
{
|
||||
url.appendQuery(queryLatestTimestamp(newerThan));
|
||||
@@ -214,7 +216,7 @@ namespace BlackCore
|
||||
|
||||
if (entities.testFlag(CEntityFlags::DistributorEntity))
|
||||
{
|
||||
CUrl url(getDistributorUrl(mode));
|
||||
url = this->getDistributorUrl(mode);
|
||||
if (!url.isEmpty())
|
||||
{
|
||||
url.appendQuery(queryLatestTimestamp(newerThan));
|
||||
@@ -229,7 +231,7 @@ namespace BlackCore
|
||||
|
||||
if (entities.testFlag(CEntityFlags::ModelEntity))
|
||||
{
|
||||
CUrl url(getModelUrl(mode));
|
||||
url = this->getModelUrl(mode);
|
||||
if (!url.isEmpty())
|
||||
{
|
||||
url.appendQuery(queryLatestTimestamp(newerThan));
|
||||
@@ -244,7 +246,7 @@ namespace BlackCore
|
||||
|
||||
if (triggeredRead != CEntityFlags::NoEntity)
|
||||
{
|
||||
emit dataRead(triggeredRead, CEntityFlags::ReadStarted, 0);
|
||||
emit dataRead(triggeredRead, CEntityFlags::ReadStarted, 0, url);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -301,12 +303,12 @@ namespace BlackCore
|
||||
if (res.hasErrorMessage())
|
||||
{
|
||||
CLogMessage::preformatted(res.lastWarningOrAbove());
|
||||
emit dataRead(CEntityFlags::LiveryEntity, CEntityFlags::ReadFailed, 0);
|
||||
emit dataRead(CEntityFlags::LiveryEntity, CEntityFlags::ReadFailed, 0, res.getUrl());
|
||||
return;
|
||||
}
|
||||
|
||||
// get all or incremental set of distributor
|
||||
emit this->dataRead(CEntityFlags::LiveryEntity, CEntityFlags::ReadParsing, 0);
|
||||
emit this->dataRead(CEntityFlags::LiveryEntity, CEntityFlags::ReadParsing, 0, res.getUrl());
|
||||
CLiveryList liveries;
|
||||
if (res.isRestricted())
|
||||
{
|
||||
@@ -321,7 +323,7 @@ namespace BlackCore
|
||||
QElapsedTimer time;
|
||||
time.start();
|
||||
liveries = CLiveryList::fromDatabaseJson(res);
|
||||
this->logParseMessage("liveries", liveries.size(), time.elapsed(), res);
|
||||
this->logParseMessage("liveries", liveries.size(), static_cast<int>(time.elapsed()), res);
|
||||
}
|
||||
|
||||
if (!this->doWorkCheck()) { return; }
|
||||
@@ -349,12 +351,12 @@ namespace BlackCore
|
||||
if (res.hasErrorMessage())
|
||||
{
|
||||
CLogMessage::preformatted(res.lastWarningOrAbove());
|
||||
emit dataRead(CEntityFlags::DistributorEntity, CEntityFlags::ReadFailed, 0);
|
||||
emit dataRead(CEntityFlags::DistributorEntity, CEntityFlags::ReadFailed, 0, res.getUrl());
|
||||
return;
|
||||
}
|
||||
|
||||
// get all or incremental set of distributors
|
||||
emit this->dataRead(CEntityFlags::DistributorEntity, CEntityFlags::ReadParsing, 0);
|
||||
emit this->dataRead(CEntityFlags::DistributorEntity, CEntityFlags::ReadParsing, 0, res.getUrl());
|
||||
CDistributorList distributors;
|
||||
if (res.isRestricted())
|
||||
{
|
||||
@@ -369,7 +371,7 @@ namespace BlackCore
|
||||
QElapsedTimer time;
|
||||
time.start();
|
||||
distributors = CDistributorList::fromDatabaseJson(res);
|
||||
this->logParseMessage("distributors", distributors.size(), time.elapsed(), res);
|
||||
this->logParseMessage("distributors", distributors.size(), static_cast<int>(time.elapsed()), res);
|
||||
}
|
||||
|
||||
if (!this->doWorkCheck()) { return; }
|
||||
@@ -394,16 +396,16 @@ namespace BlackCore
|
||||
// required to use delete later as object is created in a different thread
|
||||
QScopedPointer<QNetworkReply, QScopedPointerDeleteLater> nwReply(nwReplyPtr);
|
||||
if (!this->doWorkCheck()) { return; }
|
||||
CDatabaseReader::JsonDatastoreResponse res = this->setStatusAndTransformReplyIntoDatastoreResponse(nwReply.data());
|
||||
const CDatabaseReader::JsonDatastoreResponse res = this->setStatusAndTransformReplyIntoDatastoreResponse(nwReply.data());
|
||||
if (res.hasErrorMessage())
|
||||
{
|
||||
CLogMessage::preformatted(res.lastWarningOrAbove());
|
||||
emit this->dataRead(CEntityFlags::ModelEntity, CEntityFlags::ReadFailed, 0);
|
||||
emit this->dataRead(CEntityFlags::ModelEntity, CEntityFlags::ReadFailed, 0, res.getUrl());
|
||||
return;
|
||||
}
|
||||
|
||||
// get all or incremental set of models
|
||||
emit this->dataRead(CEntityFlags::ModelEntity, CEntityFlags::ReadParsing, 0);
|
||||
emit this->dataRead(CEntityFlags::ModelEntity, CEntityFlags::ReadParsing, 0, res.getUrl());
|
||||
|
||||
// use prefilled data:
|
||||
// this saves a lot of parsing time as the models do not need to re-parse the sub parts
|
||||
@@ -427,7 +429,7 @@ namespace BlackCore
|
||||
QElapsedTimer time;
|
||||
time.start();
|
||||
models = CAircraftModelList::fromDatabaseJsonCaching(res, icaos, categories, liveries, distributors);
|
||||
this->logParseMessage("models", models.size(), time.elapsed(), res);
|
||||
this->logParseMessage("models", models.size(), static_cast<int>(time.elapsed()), res);
|
||||
}
|
||||
|
||||
// synchronized update
|
||||
@@ -473,6 +475,7 @@ namespace BlackCore
|
||||
else
|
||||
{
|
||||
const QJsonObject liveriesJson(CDatabaseUtils::readQJsonObjectFromDatabaseFile(fileName));
|
||||
const QUrl url = QUrl::fromLocalFile(fi.absoluteFilePath());
|
||||
if (liveriesJson.isEmpty())
|
||||
{
|
||||
msgs.push_back(CStatusMessage(this).error(u"Failed to read from file/empty file '%1'") << fileName);
|
||||
@@ -484,12 +487,12 @@ namespace BlackCore
|
||||
const CLiveryList liveries = CLiveryList::fromMultipleJsonFormats(liveriesJson);
|
||||
const int c = liveries.size();
|
||||
msgs.push_back(m_liveryCache.set(liveries, fi.birthTime().toUTC().toMSecsSinceEpoch()));
|
||||
emit this->dataRead(CEntityFlags::LiveryEntity, CEntityFlags::ReadFinished, c);
|
||||
emit this->dataRead(CEntityFlags::LiveryEntity, CEntityFlags::ReadFinished, c, url);
|
||||
reallyRead |= CEntityFlags::LiveryEntity;
|
||||
}
|
||||
catch (const CJsonException &ex)
|
||||
{
|
||||
emit this->dataRead(CEntityFlags::LiveryEntity, CEntityFlags::ReadFailed, 0);
|
||||
emit this->dataRead(CEntityFlags::LiveryEntity, CEntityFlags::ReadFailed, 0, url);
|
||||
msgs.push_back(ex.toStatusMessage(this, QStringLiteral("Reading liveries from '%1'").arg(fileName)));
|
||||
}
|
||||
}
|
||||
@@ -511,6 +514,8 @@ namespace BlackCore
|
||||
else
|
||||
{
|
||||
const QJsonObject modelsJson(CDatabaseUtils::readQJsonObjectFromDatabaseFile(fileName));
|
||||
const QUrl url = QUrl::fromLocalFile(fi.absoluteFilePath());
|
||||
|
||||
if (modelsJson.isEmpty())
|
||||
{
|
||||
msgs.push_back(CStatusMessage(this).error(u"Failed to read from file/empty file '%1'") << fileName);
|
||||
@@ -522,12 +527,12 @@ namespace BlackCore
|
||||
const CAircraftModelList models = CAircraftModelList::fromMultipleJsonFormats(modelsJson);
|
||||
const int c = models.size();
|
||||
msgs.push_back(m_modelCache.set(models, fi.birthTime().toUTC().toMSecsSinceEpoch()));
|
||||
emit this->dataRead(CEntityFlags::ModelEntity, CEntityFlags::ReadFinished, c);
|
||||
emit this->dataRead(CEntityFlags::ModelEntity, CEntityFlags::ReadFinished, c, url);
|
||||
reallyRead |= CEntityFlags::ModelEntity;
|
||||
}
|
||||
catch (const CJsonException &ex)
|
||||
{
|
||||
emit this->dataRead(CEntityFlags::ModelEntity, CEntityFlags::ReadFailed, 0);
|
||||
emit this->dataRead(CEntityFlags::ModelEntity, CEntityFlags::ReadFailed, 0, url);
|
||||
msgs.push_back(ex.toStatusMessage(this, QStringLiteral("Reading models from '%1'").arg(fileName)));
|
||||
}
|
||||
}
|
||||
@@ -549,6 +554,8 @@ namespace BlackCore
|
||||
else
|
||||
{
|
||||
const QJsonObject distributorsJson(CDatabaseUtils::readQJsonObjectFromDatabaseFile(fileName));
|
||||
const QUrl url = QUrl::fromLocalFile(fi.absoluteFilePath());
|
||||
|
||||
if (distributorsJson.isEmpty())
|
||||
{
|
||||
msgs.push_back(CStatusMessage(this).error(u"Failed to read from file/empty file '%1'") << fileName);
|
||||
@@ -560,12 +567,12 @@ namespace BlackCore
|
||||
const CDistributorList distributors = CDistributorList::fromMultipleJsonFormats(distributorsJson);
|
||||
const int c = distributors.size();
|
||||
msgs.push_back(m_distributorCache.set(distributors, fi.birthTime().toUTC().toMSecsSinceEpoch()));
|
||||
emit this->dataRead(CEntityFlags::DistributorEntity, CEntityFlags::ReadFinished, c);
|
||||
emit this->dataRead(CEntityFlags::DistributorEntity, CEntityFlags::ReadFinished, c, url);
|
||||
reallyRead |= CEntityFlags::DistributorEntity;
|
||||
}
|
||||
catch (const CJsonException &ex)
|
||||
{
|
||||
emit this->dataRead(CEntityFlags::DistributorEntity, CEntityFlags::ReadFailed, 0);
|
||||
emit this->dataRead(CEntityFlags::DistributorEntity, CEntityFlags::ReadFailed, 0, url);
|
||||
msgs.push_back(ex.toStatusMessage(this, QStringLiteral("Reading distributors from '%1'").arg(fileName)));
|
||||
}
|
||||
}
|
||||
@@ -687,7 +694,7 @@ namespace BlackCore
|
||||
|
||||
bool CModelDataReader::hasChangedUrl(CEntityFlags::Entity entity, CUrl &oldUrlInfo, CUrl &newUrlInfo) const
|
||||
{
|
||||
Q_UNUSED(entity);
|
||||
Q_UNUSED(entity)
|
||||
oldUrlInfo = m_readerUrlCache.get();
|
||||
newUrlInfo = this->getBaseUrl(CDbFlags::DbReading);
|
||||
return CDatabaseReader::isChangedUrl(oldUrlInfo, newUrlInfo);
|
||||
|
||||
@@ -95,6 +95,8 @@ namespace BlackCore
|
||||
|
||||
const CReaderSettings settings = m_settings.get();
|
||||
this->logNetworkReplyReceived(nwReplyPtr);
|
||||
const QUrl url = nwReply->url();
|
||||
|
||||
if (nwReply->error() == QNetworkReply::NoError)
|
||||
{
|
||||
static const QString timestampFormat("yyyy-MM-dd HH:mm:ss");
|
||||
@@ -105,7 +107,7 @@ namespace BlackCore
|
||||
{
|
||||
CLogMessage(this).warning(u"Reading bookings wrong XML format for '%1'") << nwReply->url().toString();
|
||||
m_failures++;
|
||||
emit this->dataRead(CEntityFlags::BookingEntity, CEntityFlags::ReadFailed, 0);
|
||||
emit this->dataRead(CEntityFlags::BookingEntity, CEntityFlags::ReadFailed, 0, url);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -121,7 +123,7 @@ namespace BlackCore
|
||||
{
|
||||
CLogMessage(this).warning(u"Reading bookings wrong XML timestamp format for '%1'") << nwReply->url().toString();
|
||||
m_failures++;
|
||||
emit this->dataRead(CEntityFlags::BookingEntity, CEntityFlags::ReadFailed, 0);
|
||||
emit this->dataRead(CEntityFlags::BookingEntity, CEntityFlags::ReadFailed, 0, url);
|
||||
return;
|
||||
}
|
||||
else
|
||||
@@ -202,13 +204,13 @@ namespace BlackCore
|
||||
this->setInitialAndPeriodicTime(settings.getInitialTime().toMs(), 3 * settings.getPeriodicTime().toMs()); // slow down, we have some bookings now
|
||||
|
||||
emit this->atcBookingsRead(bookedStations);
|
||||
emit this->dataRead(CEntityFlags::BookingEntity, CEntityFlags::ReadFinished, bookedStations.size());
|
||||
emit this->dataRead(CEntityFlags::BookingEntity, CEntityFlags::ReadFinished, bookedStations.size(), url);
|
||||
} // node
|
||||
}
|
||||
else
|
||||
{
|
||||
// network error
|
||||
CLogMessage(this).warning(u"Reading bookings failed '%1' '%2'") << nwReply->errorString() << nwReply->url().toString();
|
||||
CLogMessage(this).warning(u"Reading bookings failed '%1' '%2'") << nwReply->errorString() << url.toString();
|
||||
nwReply->abort();
|
||||
m_failures++;
|
||||
if (m_failures > 3)
|
||||
@@ -217,7 +219,7 @@ namespace BlackCore
|
||||
this->setInitialAndPeriodicTime(settings.getInitialTime().toMs(), 10 * settings.getPeriodicTime().toMs()); // massively slow down
|
||||
CLogMessage(this).warning(u"Too many booking reader failures %1, slower updates") << m_failures;
|
||||
}
|
||||
emit this->dataRead(CEntityFlags::BookingEntity, CEntityFlags::ReadFailed, 0);
|
||||
emit this->dataRead(CEntityFlags::BookingEntity, CEntityFlags::ReadFailed, 0, url);
|
||||
}
|
||||
} // method
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace BlackCore
|
||||
void atcBookingsReadUnchanged();
|
||||
|
||||
//! Data have been read
|
||||
void dataRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState state, int number);
|
||||
void dataRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState state, int number, const QUrl &url);
|
||||
|
||||
protected:
|
||||
//! \name BlackCore::CThreadedReader overrides
|
||||
|
||||
@@ -218,7 +218,9 @@ namespace BlackCore
|
||||
|
||||
this->logNetworkReplyReceived(nwReplyPtr);
|
||||
QStringList illegalEquipmentCodes;
|
||||
const QString urlString = nwReply->url().toString();
|
||||
const QUrl url = nwReply->url();
|
||||
const QString urlString = url.toString();
|
||||
|
||||
if (nwReply->error() == QNetworkReply::NoError)
|
||||
{
|
||||
const QString dataFileData = nwReply->readAll();
|
||||
@@ -439,14 +441,14 @@ namespace BlackCore
|
||||
|
||||
// data read finished
|
||||
emit this->dataFileRead(lines.count());
|
||||
emit this->dataRead(CEntityFlags::VatsimDataFile, CEntityFlags::ReadFinished, lines.count());
|
||||
emit this->dataRead(CEntityFlags::VatsimDataFile, CEntityFlags::ReadFinished, lines.count(), url);
|
||||
}
|
||||
else
|
||||
{
|
||||
// network error
|
||||
CLogMessage(this).warning(u"Reading VATSIM data file failed '%1' '%2'") << nwReply->errorString() << urlString;
|
||||
nwReply->abort();
|
||||
emit this->dataRead(CEntityFlags::VatsimDataFile, CEntityFlags::ReadFailed, 0);
|
||||
emit this->dataRead(CEntityFlags::VatsimDataFile, CEntityFlags::ReadFailed, 0, url);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ namespace BlackCore
|
||||
void dataFileRead(int lines);
|
||||
|
||||
//! Data have been read
|
||||
void dataRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState state, int number);
|
||||
void dataRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState state, int number, const QUrl &url);
|
||||
|
||||
protected:
|
||||
//! \name BlackCore::CThreadedReader overrides
|
||||
|
||||
@@ -109,7 +109,9 @@ namespace BlackCore
|
||||
}
|
||||
|
||||
this->logNetworkReplyReceived(nwReplyPtr);
|
||||
const QString metarUrl = nwReply->url().toString();
|
||||
const QUrl url = nwReply->url();
|
||||
const QString metarUrl = url.toString();
|
||||
|
||||
if (nwReply->error() == QNetworkReply::NoError)
|
||||
{
|
||||
QString metarData = nwReply->readAll();
|
||||
@@ -153,14 +155,14 @@ namespace BlackCore
|
||||
}
|
||||
|
||||
emit metarsRead(metars);
|
||||
emit dataRead(CEntityFlags::MetarEntity, CEntityFlags::ReadFinished, metars.size());
|
||||
emit dataRead(CEntityFlags::MetarEntity, CEntityFlags::ReadFinished, metars.size(), url);
|
||||
}
|
||||
else
|
||||
{
|
||||
// network error
|
||||
CLogMessage(this).warning(u"Reading METARs failed '%1' for '%2'") << nwReply->errorString() << metarUrl;
|
||||
nwReply->abort();
|
||||
emit this->dataRead(CEntityFlags::MetarEntity, CEntityFlags::ReadFailed, 0);
|
||||
emit this->dataRead(CEntityFlags::MetarEntity, CEntityFlags::ReadFailed, 0, url);
|
||||
}
|
||||
} // method
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace BlackCore
|
||||
void metarsRead(const BlackMisc::Weather::CMetarList &metars);
|
||||
|
||||
//! Data have been read
|
||||
void dataRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState state, int number);
|
||||
void dataRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState state, int number, const QUrl &url);
|
||||
|
||||
protected:
|
||||
//! \name BlackCore::CThreadedReader overrides
|
||||
|
||||
@@ -1233,7 +1233,7 @@ namespace BlackCore
|
||||
// relay signal
|
||||
c = connect(m_sharedInfoDataReader, &CInfoDataReader::dataRead, this, &CWebDataServices::dataRead);
|
||||
Q_ASSERT_X(c, Q_FUNC_INFO, "Info reader connect failed");
|
||||
Q_UNUSED(c);
|
||||
Q_UNUSED(c)
|
||||
|
||||
// start in own thread
|
||||
m_sharedInfoDataReader->start(QThread::LowPriority);
|
||||
@@ -1330,24 +1330,28 @@ namespace BlackCore
|
||||
CLogMessage(this).info(u"Read VATSIM status file, %1 lines") << lines;
|
||||
}
|
||||
|
||||
void CWebDataServices::readFromSwiftReader(CEntityFlags::Entity entities, CEntityFlags::ReadState state, int number)
|
||||
void CWebDataServices::readFromSwiftReader(CEntityFlags::Entity entities, CEntityFlags::ReadState state, int number, const QUrl &url)
|
||||
{
|
||||
if (state == CEntityFlags::ReadStarted) { return; } // just started
|
||||
|
||||
const QString from = url.isEmpty() ? QStringLiteral("") : QStringLiteral(" from '%1'").arg(url.toString());
|
||||
const QString entStr = CEntityFlags::flagToString(entities);
|
||||
|
||||
if (CEntityFlags::isWarningOrAbove(state))
|
||||
{
|
||||
const CStatusMessage::StatusSeverity severity = CEntityFlags::flagToSeverity(state);
|
||||
if (severity == CStatusMessage::SeverityWarning)
|
||||
{
|
||||
CLogMessage(this).warning(u"Read data '%1' entries: %2 state: %3") << CEntityFlags::flagToString(entities) << number << CEntityFlags::stateToString(state);
|
||||
CLogMessage(this).warning(u"Read data '%1' entries: %2 state: %3%4") << entStr << number << CEntityFlags::stateToString(state) << from;
|
||||
}
|
||||
else
|
||||
{
|
||||
CLogMessage(this).error(u"Read data '%1' entries: %2 state: %3") << CEntityFlags::flagToString(entities) << number << CEntityFlags::stateToString(state);
|
||||
CLogMessage(this).error(u"Read data '%1' entries: %2 state: %3%4") << entStr << number << CEntityFlags::stateToString(state) << from;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CLogMessage(this).info(u"Read data '%1' entries: %2 state: %3") << CEntityFlags::flagToString(entities) << number << CEntityFlags::stateToString(state);
|
||||
CLogMessage(this).info(u"Read data '%1' entries: %2 state: %3%4") << entStr << number << CEntityFlags::stateToString(state) << from;
|
||||
}
|
||||
|
||||
m_swiftDbEntitiesRead |= entities;
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace BlackCore
|
||||
CWebDataServices(CWebReaderFlags::WebReader readerFlags, const BlackCore::Db::CDatabaseReaderConfigList &dbReaderConfig, BlackMisc::Restricted<CApplication>, QObject *parent = nullptr);
|
||||
|
||||
//! Destructor
|
||||
virtual ~CWebDataServices();
|
||||
virtual ~CWebDataServices() override;
|
||||
|
||||
//! Shutdown
|
||||
void gracefulShutdown();
|
||||
@@ -516,7 +516,7 @@ namespace BlackCore
|
||||
|
||||
signals:
|
||||
//! Combined read signal
|
||||
void dataRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState state, int number);
|
||||
void dataRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState state, int number, const QUrl &url);
|
||||
|
||||
//! Download progress for an entity
|
||||
void entityDownloadProgress(BlackMisc::Network::CEntityFlags::Entity entity, int logId, int progress, qint64 current, qint64 max, const QUrl &url);
|
||||
@@ -580,7 +580,7 @@ namespace BlackCore
|
||||
void vatsimStatusFileRead(int lines);
|
||||
|
||||
//! Read finished from reader
|
||||
void readFromSwiftReader(BlackMisc::Network::CEntityFlags::Entity entities, BlackMisc::Network::CEntityFlags::ReadState state, int number);
|
||||
void readFromSwiftReader(BlackMisc::Network::CEntityFlags::Entity entities, BlackMisc::Network::CEntityFlags::ReadState state, int number, const QUrl &url);
|
||||
|
||||
//! Init the readers
|
||||
void initReaders(CWebReaderFlags::WebReader readersNeeded, BlackMisc::Network::CEntityFlags::Entity entities);
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace BlackGui
|
||||
connect(ui->tvp_AirlineIcao, &CAirlineIcaoCodeView::requestNewBackendData, this, &CDbAirlineIcaoComponent::onReload);
|
||||
connect(sGui->getWebDataServices(), &CWebDataServices::dataRead, this, &CDbAirlineIcaoComponent::onIcaoRead, Qt::QueuedConnection);
|
||||
connect(sGui->getWebDataServices(), &CWebDataServices::entityDownloadProgress, this, &CDbAirlineIcaoComponent::onEntityDownloadProgress, Qt::QueuedConnection);
|
||||
this->onIcaoRead(CEntityFlags::AirlineIcaoEntity, CEntityFlags::ReadFinished, sGui->getWebDataServices()->getAirlineIcaoCodesCount());
|
||||
this->onIcaoRead(CEntityFlags::AirlineIcaoEntity, CEntityFlags::ReadFinished, sGui->getWebDataServices()->getAirlineIcaoCodesCount(), {});
|
||||
}
|
||||
|
||||
CDbAirlineIcaoComponent::~CDbAirlineIcaoComponent()
|
||||
@@ -55,9 +55,11 @@ namespace BlackGui
|
||||
return ui->tvp_AirlineIcao;
|
||||
}
|
||||
|
||||
void CDbAirlineIcaoComponent::onIcaoRead(CEntityFlags::Entity entity, CEntityFlags::ReadState readState, int count)
|
||||
void CDbAirlineIcaoComponent::onIcaoRead(CEntityFlags::Entity entity, CEntityFlags::ReadState readState, int count, const QUrl &url)
|
||||
{
|
||||
Q_UNUSED(count);
|
||||
Q_UNUSED(count)
|
||||
Q_UNUSED(url)
|
||||
|
||||
if (!sGui || sGui->isShuttingDown() || !sGui->hasWebDataServices()) { return; }
|
||||
if (!entity.testFlag(CEntityFlags::AirlineIcaoEntity)) { return; }
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace BlackGui
|
||||
|
||||
private:
|
||||
//! ICAO codes have been read
|
||||
void onIcaoRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState readState, int count);
|
||||
void onIcaoRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState readState, int count, const QUrl &url);
|
||||
|
||||
//! Download progress for an entity
|
||||
void onEntityDownloadProgress(BlackMisc::Network::CEntityFlags::Entity entity, int logId, int progress, qint64 current, qint64 max, const QUrl &url);
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace BlackGui
|
||||
{
|
||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||
if (!myself) { return; }
|
||||
this->onCodesRead(CEntityFlags::AirlineIcaoEntity, CEntityFlags::ReadFinished, c);
|
||||
this->onCodesRead(CEntityFlags::AirlineIcaoEntity, CEntityFlags::ReadFinished, c, {});
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -130,8 +130,10 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
void CDbAirlineIcaoSelectorBase::onCodesRead(CEntityFlags::Entity entity, CEntityFlags::ReadState readState, int count)
|
||||
void CDbAirlineIcaoSelectorBase::onCodesRead(CEntityFlags::Entity entity, CEntityFlags::ReadState readState, int count, const QUrl &url)
|
||||
{
|
||||
Q_UNUSED(url)
|
||||
|
||||
if (!sGui) { return; }
|
||||
if (entity.testFlag(CEntityFlags::AirlineIcaoEntity) && CEntityFlags::isFinishedReadState(readState))
|
||||
{
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace BlackGui
|
||||
|
||||
private:
|
||||
//! Airlines have been read
|
||||
void onCodesRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState readState, int count);
|
||||
void onCodesRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState readState, int count, const QUrl &url);
|
||||
|
||||
//! Data have been changed
|
||||
void onCompleterActivated(const QString &icaoString);
|
||||
|
||||
@@ -121,11 +121,12 @@ namespace BlackGui
|
||||
this->setVisible(true);
|
||||
}
|
||||
|
||||
void CDbAutoStashingComponent::onEntitiesRead(CEntityFlags::Entity entity, CEntityFlags::ReadState readState, int count)
|
||||
void CDbAutoStashingComponent::onEntitiesRead(CEntityFlags::Entity entity, CEntityFlags::ReadState readState, int count, const QUrl &url)
|
||||
{
|
||||
if (readState != CEntityFlags::ReadFinished) { return; }
|
||||
Q_UNUSED(count);
|
||||
Q_UNUSED(entity);
|
||||
Q_UNUSED(count)
|
||||
Q_UNUSED(entity)
|
||||
Q_UNUSED(url)
|
||||
}
|
||||
|
||||
void CDbAutoStashingComponent::resetDescription()
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace BlackGui
|
||||
QScopedPointer<Ui::CDbAutoStashingComponent> ui;
|
||||
|
||||
//! Data have been read
|
||||
void onEntitiesRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState readState, int count);
|
||||
void onEntitiesRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState readState, int count, const QUrl &url);
|
||||
|
||||
//! Reset the description settings
|
||||
void resetDescription();
|
||||
|
||||
@@ -39,15 +39,17 @@ namespace BlackGui
|
||||
ui->tvp_Countries->allowDragDrop(true, false);
|
||||
|
||||
connect(sApp->getWebDataServices(), &CWebDataServices::dataRead, this, &CDbCountryComponent::onCountriesRead, Qt::QueuedConnection);
|
||||
this->onCountriesRead(CEntityFlags::CountryEntity, CEntityFlags::ReadFinished, sGui->getWebDataServices()->getCountriesCount());
|
||||
this->onCountriesRead(CEntityFlags::CountryEntity, CEntityFlags::ReadFinished, sGui->getWebDataServices()->getCountriesCount(), {});
|
||||
}
|
||||
|
||||
CDbCountryComponent::~CDbCountryComponent()
|
||||
{ }
|
||||
|
||||
void CDbCountryComponent::onCountriesRead(CEntityFlags::Entity entity, CEntityFlags::ReadState readState, int count)
|
||||
void CDbCountryComponent::onCountriesRead(CEntityFlags::Entity entity, CEntityFlags::ReadState readState, int count, const QUrl &url)
|
||||
{
|
||||
Q_UNUSED(count);
|
||||
Q_UNUSED(count)
|
||||
Q_UNUSED(url)
|
||||
|
||||
if (!sGui || sGui->isShuttingDown() || !sGui->getWebDataServices()) { return; }
|
||||
if (entity.testFlag(CEntityFlags::CountryEntity) && CEntityFlags::isFinishedReadState(readState))
|
||||
{
|
||||
|
||||
@@ -42,11 +42,11 @@ namespace BlackGui
|
||||
explicit CDbCountryComponent(QWidget *parent = nullptr);
|
||||
|
||||
//! Destructor
|
||||
virtual ~CDbCountryComponent();
|
||||
virtual ~CDbCountryComponent() override;
|
||||
|
||||
private:
|
||||
//! Countries have been read
|
||||
void onCountriesRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState readState, int count);
|
||||
void onCountriesRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState readState, int count, const QUrl &url);
|
||||
|
||||
//! Reload models
|
||||
void onReload();
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace BlackGui
|
||||
connect(ui->le_Livery, &QLineEdit::returnPressed, this, &CDbLiverySelectorComponent::onDataChanged);
|
||||
|
||||
connect(sGui->getWebDataServices(), &CWebDataServices::dataRead, this, &CDbLiverySelectorComponent::onLiveriesRead, Qt::QueuedConnection);
|
||||
this->onLiveriesRead(CEntityFlags::LiveryEntity, CEntityFlags::ReadFinished, sGui->getWebDataServices()->getLiveriesCount());
|
||||
this->onLiveriesRead(CEntityFlags::LiveryEntity, CEntityFlags::ReadFinished, sGui->getWebDataServices()->getLiveriesCount(), {});
|
||||
}
|
||||
|
||||
CDbLiverySelectorComponent::~CDbLiverySelectorComponent()
|
||||
@@ -183,14 +183,16 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
void CDbLiverySelectorComponent::onLiveriesRead(CEntityFlags::Entity entity, CEntityFlags::ReadState readState, int count)
|
||||
void CDbLiverySelectorComponent::onLiveriesRead(CEntityFlags::Entity entity, CEntityFlags::ReadState readState, int count, const QUrl &url)
|
||||
{
|
||||
Q_UNUSED(url)
|
||||
|
||||
if (!sGui || sGui->isShuttingDown() || !sGui->hasWebDataServices()) { return; }
|
||||
if (entity.testFlag(CEntityFlags::LiveryEntity) && CEntityFlags::isFinishedReadState(readState))
|
||||
{
|
||||
if (count > 0)
|
||||
{
|
||||
QStringList codes(sApp->getWebDataServices()->getLiveries().getCombinedCodesPlusInfo(true));
|
||||
const QStringList codes(sApp->getWebDataServices()->getLiveries().getCombinedCodesPlusInfo(true));
|
||||
QCompleter *c = new QCompleter(codes, this);
|
||||
c->setCaseSensitivity(Qt::CaseInsensitive);
|
||||
c->setCompletionMode(QCompleter::PopupCompletion);
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace BlackGui
|
||||
void onCompleterActivated(const QString &liveryCode);
|
||||
|
||||
//! Distributors have been read
|
||||
void onLiveriesRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState readState, int count);
|
||||
void onLiveriesRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState readState, int count, const QUrl &url);
|
||||
|
||||
//! Strip extra info from livery code
|
||||
QString stripExtraInfo(const QString &liveryCode) const;
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
void CDbLoadDataDialog::onDataRead(CEntityFlags::Entity entity, CEntityFlags::ReadState state, int number)
|
||||
void CDbLoadDataDialog::onDataRead(CEntityFlags::Entity entity, CEntityFlags::ReadState state, int number, const QUrl &url)
|
||||
{
|
||||
if (m_pendingEntities == CEntityFlags::NoEntity) { return; } // not triggered from here
|
||||
if (!m_pendingEntities.testFlag(CEntityFlags::entityToEntityFlag(entity))) { return; }
|
||||
@@ -115,7 +115,7 @@ namespace BlackGui
|
||||
if (!CEntityFlags::isFinishedReadStateOrFailure(state)) { return; }
|
||||
if (state == CEntityFlags::ReadFailed)
|
||||
{
|
||||
CLogMessage(this).warning(u"Read failed for %1") << e;
|
||||
CLogMessage(this).warning(u"Read failed for %1 from '%2'") << e << url.toString();
|
||||
}
|
||||
|
||||
m_pendingEntities &= ~entity;
|
||||
@@ -157,12 +157,12 @@ namespace BlackGui
|
||||
|
||||
void CDbLoadDataDialog::onEntityDownloadProgress(CEntityFlags::Entity entity, int logId, int progress, qint64 current, qint64 max, const QUrl &url)
|
||||
{
|
||||
Q_UNUSED(entity);
|
||||
Q_UNUSED(logId);
|
||||
Q_UNUSED(progress);
|
||||
Q_UNUSED(current);
|
||||
Q_UNUSED(max);
|
||||
Q_UNUSED(url);
|
||||
Q_UNUSED(entity)
|
||||
Q_UNUSED(logId)
|
||||
Q_UNUSED(progress)
|
||||
Q_UNUSED(current)
|
||||
Q_UNUSED(max)
|
||||
Q_UNUSED(url)
|
||||
}
|
||||
|
||||
void CDbLoadDataDialog::onRejected()
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace BlackGui
|
||||
void onButtonClicked(QAbstractButton *button);
|
||||
|
||||
//! Data are/have been read
|
||||
void onDataRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState state, int number);
|
||||
void onDataRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState state, int number, const QUrl &url);
|
||||
|
||||
//! Download progress
|
||||
void onEntityDownloadProgress(BlackMisc::Network::CEntityFlags::Entity entity, int logId, int progress, qint64 current, qint64 max, const QUrl &url);
|
||||
|
||||
@@ -365,9 +365,11 @@ namespace BlackGui
|
||||
sGui->getWebDataServices()->triggerReadOfSharedInfoObjects();
|
||||
}
|
||||
|
||||
void CDbLoadOverviewComponent::dataLoaded(CEntityFlags::Entity entities, CEntityFlags::ReadState state, int number)
|
||||
void CDbLoadOverviewComponent::dataLoaded(CEntityFlags::Entity entities, CEntityFlags::ReadState state, int number, const QUrl &url)
|
||||
{
|
||||
Q_UNUSED(number);
|
||||
Q_UNUSED(number)
|
||||
Q_UNUSED(url)
|
||||
|
||||
if (!CEntityFlags::isFinishedReadState(state)) return;
|
||||
if (!entities.testFlag(CEntityFlags::SharedInfoObjectEntity) && !entities.testFlag(CEntityFlags::DbInfoObjectEntity) && !CEntityFlags::anySwiftDbEntity(entities)) { return; }
|
||||
m_loadInProgress = false;
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace BlackGui
|
||||
void setSharedUrlValues();
|
||||
|
||||
//! Data have been loaded
|
||||
void dataLoaded(BlackMisc::Network::CEntityFlags::Entity entities, BlackMisc::Network::CEntityFlags::ReadState state, int number);
|
||||
void dataLoaded(BlackMisc::Network::CEntityFlags::Entity entities, BlackMisc::Network::CEntityFlags::ReadState state, int number, const QUrl &url);
|
||||
|
||||
//! Load info objects if not already loaded
|
||||
void loadInfoObjects();
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace BlackGui
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CDbModelComponent::onStyleSheetChanged, Qt::QueuedConnection);
|
||||
connect(sGui->getWebDataServices(), &CWebDataServices::dataRead, this, &CDbModelComponent::onModelsRead);
|
||||
connect(sGui->getWebDataServices(), &CWebDataServices::entityDownloadProgress, this, &CDbModelComponent::onEntityDownloadProgress, Qt::QueuedConnection);
|
||||
this->onModelsRead(CEntityFlags::ModelEntity, CEntityFlags::ReadFinished, sApp->getWebDataServices()->getModelsCount());
|
||||
this->onModelsRead(CEntityFlags::ModelEntity, CEntityFlags::ReadFinished, sApp->getWebDataServices()->getModelsCount(), {});
|
||||
}
|
||||
|
||||
CDbModelComponent::~CDbModelComponent()
|
||||
@@ -84,9 +84,11 @@ namespace BlackGui
|
||||
sGui->getWebDataServices()->triggerLoadingDirectlyFromDb(CEntityFlags::ModelEntity, ts);
|
||||
}
|
||||
|
||||
void CDbModelComponent::onModelsRead(CEntityFlags::Entity entity, CEntityFlags::ReadState readState, int count)
|
||||
void CDbModelComponent::onModelsRead(CEntityFlags::Entity entity, CEntityFlags::ReadState readState, int count, const QUrl &url)
|
||||
{
|
||||
Q_UNUSED(count);
|
||||
Q_UNUSED(count)
|
||||
Q_UNUSED(url)
|
||||
|
||||
if (!sGui || sGui->isShuttingDown() || !sGui->getWebDataServices()) { return; }
|
||||
if (!entity.testFlag(CEntityFlags::ModelEntity)) { return; }
|
||||
|
||||
@@ -116,7 +118,7 @@ namespace BlackGui
|
||||
{
|
||||
if (!entity.testFlag(CEntityFlags::ModelEntity)) { return; }
|
||||
this->showDownloadProgress(progress, current, max, url, 5000);
|
||||
Q_UNUSED(logId);
|
||||
Q_UNUSED(logId)
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace BlackGui
|
||||
|
||||
private:
|
||||
//! Models have been read
|
||||
void onModelsRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState readState, int count);
|
||||
void onModelsRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState readState, int count, const QUrl &url);
|
||||
|
||||
//! Reload models
|
||||
void onReload();
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace BlackGui
|
||||
Q_ASSERT_X(c, Q_FUNC_INFO, "Failed connect");
|
||||
}
|
||||
|
||||
Q_UNUSED(c);
|
||||
Q_UNUSED(c)
|
||||
}
|
||||
|
||||
CInfoBarWebReadersStatusBase::~CInfoBarWebReadersStatusBase()
|
||||
|
||||
@@ -169,7 +169,7 @@ namespace BlackGui
|
||||
this->validateAircraftValues();
|
||||
ui->form_Pilot->validate();
|
||||
ui->cb_AutoLogoff->setChecked(m_networkSetup.useAutoLogoff());
|
||||
this->onWebServiceDataRead(CEntityFlags::VatsimDataFile, CEntityFlags::ReadFinished, -1);
|
||||
this->onWebServiceDataRead(CEntityFlags::VatsimDataFile, CEntityFlags::ReadFinished, -1, {});
|
||||
this->reloadOtherServersSetup();
|
||||
|
||||
connect(ui->pb_OverrideCredentialsVatsim, &QPushButton::clicked, this, &CLoginComponent::overrideCredentialsToPilot);
|
||||
@@ -362,11 +362,13 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
void CLoginComponent::onWebServiceDataRead(CEntityFlags::Entity entity, CEntityFlags::ReadState state, int number)
|
||||
void CLoginComponent::onWebServiceDataRead(CEntityFlags::Entity entity, CEntityFlags::ReadState state, int number, const QUrl &url)
|
||||
{
|
||||
if (!CEntityFlags::isFinishedReadState(state)) { return; }
|
||||
if (!sGui || !sGui->getIContextNetwork() || sGui->isShuttingDown()) { return; }
|
||||
|
||||
Q_UNUSED(number)
|
||||
Q_UNUSED(url)
|
||||
|
||||
if (entity == CEntityFlags::VatsimDataFile)
|
||||
{
|
||||
@@ -682,7 +684,7 @@ namespace BlackGui
|
||||
|
||||
void CLoginComponent::onChangedAirlineIcao(const CAirlineIcaoCode &icao)
|
||||
{
|
||||
Q_UNUSED(icao);
|
||||
Q_UNUSED(icao)
|
||||
this->validateAircraftValues();
|
||||
}
|
||||
|
||||
|
||||
@@ -162,7 +162,7 @@ namespace BlackGui
|
||||
void loginCancelled();
|
||||
|
||||
//! VATSIM data file was loaded
|
||||
void onWebServiceDataRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState state, int number);
|
||||
void onWebServiceDataRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState state, int number, const QUrl &url);
|
||||
|
||||
//! Validate aircaft
|
||||
bool validateAircraftValues();
|
||||
|
||||
@@ -200,8 +200,11 @@ namespace BlackGui
|
||||
ui->tvp_ResultMessages->updateContainer(msgs);
|
||||
}
|
||||
|
||||
void CModelMatcherComponent::onWebDataRead(CEntityFlags::Entity entity, CEntityFlags::ReadState state, int number)
|
||||
void CModelMatcherComponent::onWebDataRead(CEntityFlags::Entity entity, CEntityFlags::ReadState state, int number, const QUrl &url)
|
||||
{
|
||||
Q_UNUSED(url)
|
||||
|
||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||
if (number > 0 && entity.testFlag(CEntityFlags::ModelEntity) && CEntityFlags::isFinishedReadState(state))
|
||||
{
|
||||
const QStringList modelStrings(sGui->getWebDataServices()->getModelStrings(true));
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace BlackGui
|
||||
void onCacheChanged(BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||
|
||||
//! Web data have been read
|
||||
void onWebDataRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState state, int number);
|
||||
void onWebDataRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState state, int number, const QUrl &url);
|
||||
|
||||
//! Display settings dialog
|
||||
void displaySettingsDialog();
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace BlackGui
|
||||
ui->tw_Network->setCurrentIndex(tab);
|
||||
|
||||
this->reloadOtherServersSetup();
|
||||
this->onWebServiceDataRead(CEntityFlags::VatsimDataFile, CEntityFlags::ReadFinished, -1);
|
||||
this->onWebServiceDataRead(CEntityFlags::VatsimDataFile, CEntityFlags::ReadFinished, -1, {});
|
||||
}
|
||||
|
||||
CNetworkDetailsComponent::~CNetworkDetailsComponent()
|
||||
@@ -142,7 +142,7 @@ namespace BlackGui
|
||||
return;
|
||||
}
|
||||
|
||||
Q_UNUSED(index);
|
||||
Q_UNUSED(index)
|
||||
const CServer server = this->getCurrentServer();
|
||||
|
||||
// only override if not yet enabled
|
||||
@@ -169,7 +169,7 @@ namespace BlackGui
|
||||
|
||||
void CNetworkDetailsComponent::onServerTabWidgetChanged(int index)
|
||||
{
|
||||
Q_UNUSED(index);
|
||||
Q_UNUSED(index)
|
||||
if (!m_updatePilotOnServerChanges) { return; }
|
||||
const bool vatsim = this->isVatsimServerSelected();
|
||||
const CServer server = vatsim ? this->getCurrentVatsimServer() : this->getCurrentOtherServer();
|
||||
@@ -184,10 +184,11 @@ namespace BlackGui
|
||||
emit this->overridePilot(server.getUser());
|
||||
}
|
||||
|
||||
void CNetworkDetailsComponent::onWebServiceDataRead(CEntityFlags::Entity entity, CEntityFlags::ReadState state, int number)
|
||||
void CNetworkDetailsComponent::onWebServiceDataRead(CEntityFlags::Entity entity, CEntityFlags::ReadState state, int number, const QUrl &url)
|
||||
{
|
||||
if (!CEntityFlags::isFinishedReadState(state)) { return; }
|
||||
Q_UNUSED(number);
|
||||
Q_UNUSED(number)
|
||||
Q_UNUSED(url)
|
||||
|
||||
if (entity == CEntityFlags::VatsimDataFile)
|
||||
{
|
||||
|
||||
@@ -134,7 +134,7 @@ namespace BlackGui
|
||||
void onOverrideCredentialsToPilot();
|
||||
|
||||
//! VATSIM data file was loaded
|
||||
void onWebServiceDataRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState state, int number);
|
||||
void onWebServiceDataRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState state, int number, const QUrl &url);
|
||||
|
||||
//! Change page
|
||||
void onChangePage();
|
||||
|
||||
Reference in New Issue
Block a user