mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-24 02:42:52 +00:00
kdeplasma-addons: extract condition from forecast if possible
fixes condition detection from wetter.com provider Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
3fa479a073
commit
d084792a32
1 changed files with 13 additions and 1 deletions
|
@ -27,6 +27,7 @@
|
|||
#include <QPropertyAnimation>
|
||||
|
||||
// KDE includes
|
||||
#include <KDebug>
|
||||
#include <KFileDialog>
|
||||
#include <KLocalizedString>
|
||||
#include <KPushButton>
|
||||
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue