From a1a57a757bf2321c41555cbe539a9efcc436ed60 Mon Sep 17 00:00:00 2001 From: Gus Grubba Date: Sat, 27 Jan 2018 13:18:02 -0500 Subject: [PATCH] Save weather structure locally. --- src/Airmap/AirMapWeatherInformation.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Airmap/AirMapWeatherInformation.cc b/src/Airmap/AirMapWeatherInformation.cc index 756ad2bcb..8b0b8dcb0 100644 --- a/src/Airmap/AirMapWeatherInformation.cc +++ b/src/Airmap/AirMapWeatherInformation.cc @@ -55,14 +55,14 @@ AirMapWeatherInformation::_requestWeatherUpdate(const QGeoCoordinate& coordinate params.weather = true; _shared.client()->status().get_status_by_point(params, [this, coordinate](const Status::GetStatus::Result& result) { if (result) { - const Status::Weather& weather = result.value().weather; + _weather = result.value().weather; _valid = true; - if(weather.icon.empty()) { + if(_weather.icon.empty()) { _icon = QStringLiteral("qrc:/airmapweather/unknown.svg"); } 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 { _valid = false; qCDebug(AirMapManagerLog) << "Request Weather Failed"; -- 2.22.0