mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 08:36:52 +08:00
Ref T121, check if Internet is accessible
* in case the internet provider is down, this is not detected * extended test to detect if access is possible * in case of downtime this indicated in status component
This commit is contained in:
committed by
Mathew Sutcliffe
parent
b70fb70d60
commit
f3847bd33c
@@ -203,7 +203,7 @@ namespace BlackCore
|
||||
this->threadAssertCheck();
|
||||
if (!this->doWorkCheck()) { return; }
|
||||
entity &= CEntityFlags::AirportEntity;
|
||||
if (!this->isNetworkAccessible())
|
||||
if (!this->isInternetAccessible())
|
||||
{
|
||||
emit this->dataRead(entity, CEntityFlags::ReadSkipped, 0);
|
||||
return;
|
||||
|
||||
@@ -198,7 +198,7 @@ namespace BlackCore
|
||||
|
||||
// ps_read is implemented in the derived classes
|
||||
if (entities == CEntityFlags::NoEntity) { return; }
|
||||
if (!this->isNetworkAccessible(QString("No network, will not read %1").arg(CEntityFlags::flagToString(entities)))) { return; }
|
||||
if (!this->isInternetAccessible(QString("No network/internet access, will not read %1").arg(CEntityFlags::flagToString(entities)))) { return; }
|
||||
|
||||
const bool s = QMetaObject::invokeMethod(this, "ps_read",
|
||||
Q_ARG(BlackMisc::Network::CEntityFlags::Entity, entities),
|
||||
@@ -370,7 +370,7 @@ namespace BlackCore
|
||||
|
||||
bool CDatabaseReader::requestHeadersOfSharedFiles(CEntityFlags::Entity entities)
|
||||
{
|
||||
if (!this->isNetworkAccessible(QString("No network, will not read shared file headers for %1").arg(CEntityFlags::flagToString(entities)))) { return false; }
|
||||
if (!this->isInternetAccessible(QString("No network/internet access, will not read shared file headers for %1").arg(CEntityFlags::flagToString(entities)))) { return false; }
|
||||
|
||||
CEntityFlags::Entity allEntities(this->maskBySupportedEntities(entities));
|
||||
CEntityFlags::Entity currentEntity = CEntityFlags::iterateDbEntities(allEntities);
|
||||
|
||||
@@ -134,7 +134,7 @@ namespace BlackCore
|
||||
this->threadAssertCheck(); // runs in background thread
|
||||
if (!this->doWorkCheck()) { return; }
|
||||
entities &= CEntityFlags::AllIcaoAndCountries;
|
||||
if (!this->isNetworkAccessible())
|
||||
if (!this->isInternetAccessible())
|
||||
{
|
||||
emit this->dataRead(entities, CEntityFlags::ReadSkipped, 0);
|
||||
return;
|
||||
|
||||
@@ -95,6 +95,7 @@ namespace BlackCore
|
||||
|
||||
void CInfoDataReader::read()
|
||||
{
|
||||
if (!this->doWorkCheck()) { return; }
|
||||
const CUrl url(this->getInfoObjectsUrl());
|
||||
if (!url.isEmpty())
|
||||
{
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace BlackCore
|
||||
this->threadAssertCheck();
|
||||
if (!this->doWorkCheck()) { return; }
|
||||
entities &= CEntityFlags::DistributorLiveryModel;
|
||||
if (!this->isNetworkAccessible())
|
||||
if (!this->isInternetAccessible())
|
||||
{
|
||||
emit this->dataRead(entities, CEntityFlags::ReadSkipped, 0);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user