diff --git a/kdeplasma-addons/wallpapers/weather/weatherwallpaper.cpp b/kdeplasma-addons/wallpapers/weather/weatherwallpaper.cpp index a62dd338..3b25bc9f 100644 --- a/kdeplasma-addons/wallpapers/weather/weatherwallpaper.cpp +++ b/kdeplasma-addons/wallpapers/weather/weatherwallpaper.cpp @@ -27,6 +27,7 @@ #include // KDE includes +#include #include #include #include @@ -588,7 +589,18 @@ void WeatherWallpaper::dataUpdated(const QString &source, const Plasma::DataEngi return; } - m_condition = data[QLatin1String( "Condition Icon" )].toString(); + m_condition = data[QLatin1String("Condition Icon")].toString(); + // qDebug() << Q_FUNC_INFO << source << m_condition; + if (m_condition.isEmpty() || m_condition == QLatin1String("weather-none-available")) { + const QString todayforecast = data[QLatin1String("Short Forecast Day 0")].toString(); + const QStringList splitforecast = todayforecast.split(QLatin1Char('|')); + if (splitforecast.size() == 6) { + m_condition = splitforecast.at(1); + } else if (!splitforecast.isEmpty()) { + kWarning() << "forecast data has changed"; + } + // qDebug() << Q_FUNC_INFO << splitforecast << m_condition; + } loadImage(); }