Browse Source

Save weather structure locally.

QGC4.4
Gus Grubba 7 years ago
parent
commit
a1a57a757b
  1. 8
      src/Airmap/AirMapWeatherInformation.cc

8
src/Airmap/AirMapWeatherInformation.cc

@ -55,14 +55,14 @@ AirMapWeatherInformation::_requestWeatherUpdate(const QGeoCoordinate& coordinate
params.weather = true; params.weather = true;
_shared.client()->status().get_status_by_point(params, [this, coordinate](const Status::GetStatus::Result& result) { _shared.client()->status().get_status_by_point(params, [this, coordinate](const Status::GetStatus::Result& result) {
if (result) { if (result) {
const Status::Weather& weather = result.value().weather; _weather = result.value().weather;
_valid = true; _valid = true;
if(weather.icon.empty()) { if(_weather.icon.empty()) {
_icon = QStringLiteral("qrc:/airmapweather/unknown.svg"); _icon = QStringLiteral("qrc:/airmapweather/unknown.svg");
} else { } else {
_icon = QStringLiteral("qrc:/airmapweather/") + QString::fromStdString(weather.icon) + QStringLiteral(".svg"); _icon = QStringLiteral("qrc:/airmapweather/") + QString::fromStdString(_weather.icon) + QStringLiteral(".svg");
} }
qCDebug(AirMapManagerLog) << "Weather Info: " << _valid << "Icon:" << QString::fromStdString(weather.icon) << "Condition:" << QString::fromStdString(weather.condition) << "Temp:" << weather.temperature; qCDebug(AirMapManagerLog) << "Weather Info: " << _valid << "Icon:" << QString::fromStdString(_weather.icon) << "Condition:" << QString::fromStdString(_weather.condition) << "Temp:" << _weather.temperature;
} else { } else {
_valid = false; _valid = false;
qCDebug(AirMapManagerLog) << "Request Weather Failed"; qCDebug(AirMapManagerLog) << "Request Weather Failed";

Loading…
Cancel
Save