mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
refs #857, check if network is accessible in readers
* new read state "skipped" * renamed to "isNetworkConnectedAndAccessible" * checking before reading, which would only fail if network is not accessible
This commit is contained in:
committed by
Mathew Sutcliffe
parent
04e980a6ae
commit
1ced7f3c0b
@@ -65,9 +65,14 @@ namespace BlackWxPlugin
|
||||
m_maxRange = range;
|
||||
if (m_gribData.isEmpty())
|
||||
{
|
||||
CLogMessage(this).debug() << "Started to download GFS data...";
|
||||
QUrl url = getDownloadUrl();
|
||||
CLogMessage(this).debug() << "Download url:" << url.toString();
|
||||
if (!sApp->isNetworkConnectedAndAccessible())
|
||||
{
|
||||
CLogMessage(this).error("No wether download since network not accessible");
|
||||
return;
|
||||
}
|
||||
|
||||
const QUrl url = getDownloadUrl();
|
||||
CLogMessage(this).debug() << "Started to download GFS data from" << url.toString();
|
||||
QNetworkRequest request(url);
|
||||
sApp->getFromNetwork(request, { this, &CWeatherDataGfs::ps_parseGfsFile });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user