diff --git a/dataengines/weather/ions/ion.h b/dataengines/weather/ions/ion.h --- a/dataengines/weather/ions/ion.h +++ b/dataengines/weather/ions/ion.h @@ -119,10 +119,10 @@ public: - enum ConditionIcons { ClearDay = 1, FewCloudsDay, PartlyCloudyDay, Overcast, + enum ConditionIcons { ClearDay = 1, ClearWindyDay, FewCloudsDay, FewCloudsWindyDay, PartlyCloudyDay, PartlyCloudyWindyDay, Overcast, OvercastWindy, Rain, LightRain, Showers, ChanceShowersDay, Thunderstorm, Hail, - Snow, LightSnow, Flurries, FewCloudsNight, ChanceShowersNight, - PartlyCloudyNight, ClearNight, Mist, Haze, FreezingRain, + Snow, LightSnow, Flurries, FewCloudsNight, FewCloudsWindyNight, ChanceShowersNight, + PartlyCloudyNight, PartlyCloudyWindyNight, ClearNight, ClearWindyNight, Mist, Haze, FreezingRain, RainSnow, FreezingDrizzle, ChanceThunderstormDay, ChanceThunderstormNight, ChanceSnowDay, ChanceSnowNight, NotAvailable }; diff --git a/dataengines/weather/ions/ion.cpp b/dataengines/weather/ions/ion.cpp --- a/dataengines/weather/ions/ion.cpp +++ b/dataengines/weather/ions/ion.cpp @@ -146,12 +146,20 @@ switch (condition) { case ClearDay: return QStringLiteral("weather-clear"); + case ClearWindyDay: + return QStringLiteral("weather-clear-wind"); case FewCloudsDay: return QStringLiteral("weather-few-clouds"); + case FewCloudsWindyDay: + return QStringLiteral("weather-few-clouds-wind"); case PartlyCloudyDay: return QStringLiteral("weather-clouds"); + case PartlyCloudyWindyDay: + return QStringLiteral("weather-clouds-wind"); case Overcast: return QStringLiteral("weather-overcast"); + case OvercastWindy: + return QStringLiteral("weather-overcast-wind"); case Rain: return QStringLiteral("weather-showers"); case LightRain: @@ -180,10 +188,16 @@ return QStringLiteral("weather-snow-rain"); case FewCloudsNight: return QStringLiteral("weather-few-clouds-night"); + case FewCloudsWindyNight: + return QStringLiteral("weather-few-clouds-wind-night"); case PartlyCloudyNight: return QStringLiteral("weather-clouds-night"); + case PartlyCloudyWindyNight: + return QStringLiteral("weather-clouds-wind-night"); case ClearNight: return QStringLiteral("weather-clear-night"); + case ClearWindyNight: + return QStringLiteral("weather-clear-wind-night"); case Mist: return QStringLiteral("weather-fog"); case Haze: diff --git a/dataengines/weather/ions/noaa/ion_noaa.cpp b/dataengines/weather/ions/noaa/ion_noaa.cpp --- a/dataengines/weather/ions/noaa/ion_noaa.cpp +++ b/dataengines/weather/ions/noaa/ion_noaa.cpp @@ -734,29 +734,64 @@ weather.contains(QLatin1String("mostly clear")) || weather.contains(QLatin1String("increasing clouds")) || weather.contains(QLatin1String("becoming cloudy")) || weather.contains(QLatin1String("clearing")) || weather.contains(QLatin1String("decreasing clouds")) || weather.contains(QLatin1String("becoming sunny"))) { - result = isDayTime ? IonInterface::FewCloudsDay : IonInterface::FewCloudsNight; + if (weather.contains(QLatin1String("breezy")) || + weather.contains(QLatin1String("wind")) || + weather.contains (QLatin1String("gust"))) { + result = isDayTime ? IonInterface::FewCloudsWindyDay : IonInterface::FewCloudsWindyNight; + } else { + result = isDayTime ? IonInterface::FewCloudsDay : IonInterface::FewCloudsNight; + } } else if (weather.contains(QLatin1String("partly cloudy")) || weather.contains(QLatin1String("partly sunny")) || weather.contains(QLatin1String("partly clear"))) { - result = isDayTime ? IonInterface::PartlyCloudyDay : IonInterface::PartlyCloudyNight; + if (weather.contains(QLatin1String("breezy")) || + weather.contains(QLatin1String("wind")) || + weather.contains (QLatin1String("gust"))) { + result = isDayTime ? IonInterface::PartlyCloudyWindyDay : IonInterface::PartlyCloudyWindyNight; + } else { + result = isDayTime ? IonInterface::PartlyCloudyDay : IonInterface::PartlyCloudyNight; + } } else if (weather.contains(QLatin1String("overcast")) || weather.contains(QLatin1String("cloudy"))) { - result = IonInterface::Overcast; + if (weather.contains(QLatin1String("breezy")) || + weather.contains(QLatin1String("wind")) || + weather.contains (QLatin1String("gust"))) { + result = IonInterface::OvercastWindy; + } else { + result = IonInterface::Overcast; + } } else if (weather.contains(QLatin1String("haze")) || weather.contains(QLatin1String("smoke")) || weather.contains(QLatin1String("dust")) || weather.contains(QLatin1String("sand"))) { result = IonInterface::Haze; } else if (weather.contains(QLatin1String("fair")) || weather.contains(QLatin1String("clear")) || weather.contains(QLatin1String("sunny"))) { - result = isDayTime ? IonInterface::ClearDay : IonInterface::ClearNight; + if (weather.contains(QLatin1String("breezy")) || + weather.contains(QLatin1String("wind")) || + weather.contains (QLatin1String("gust"))) { + result = isDayTime ? IonInterface::ClearWindyDay : IonInterface::ClearWindyNight; + } else { + result = isDayTime ? IonInterface::ClearDay : IonInterface::ClearNight; + } } else if (weather.contains(QLatin1String("fog"))) { result = IonInterface::Mist; } else if (weather.contains(QLatin1String("hot"))) { // temperature condition has not hint about air ingredients, so let's assume the sky is clear when it is hot - result = isDayTime ? IonInterface::ClearDay : IonInterface::ClearNight; + if (weather.contains(QLatin1String("breezy")) || + weather.contains(QLatin1String("wind")) || + weather.contains (QLatin1String("gust"))) { + result = isDayTime ? IonInterface::ClearWindyDay : IonInterface::ClearWindyNight; + } else { + result = isDayTime ? IonInterface::ClearDay : IonInterface::ClearNight; + } + } else if (weather.contains (QLatin1String("breezy")) || + weather.contains (QLatin1String("wind")) || + weather.contains (QLatin1String("gust"))) { + // Assume a clear sky when it's windy but no clouds have been mentioned + result = isDayTime ? IonInterface::ClearWindyDay : IonInterface::ClearWindyNight; } else { result = IonInterface::NotAvailable; }