[Marble-commits] KDE/kdeedu/marble/src/plugins/render/weather
Bastian Holst
bastianholst at gmx.de
Mon Aug 24 20:45:24 CEST 2009
SVN commit 1015167 by bholst:
Marble Weather Plugin: Adding credits to weather overview.
M +6 -1 BBCWeatherItem.cpp
M +2 -0 BBCWeatherItem.h
M +11 -0 WeatherItem.cpp
M +2 -0 WeatherItem.h
--- trunk/KDE/kdeedu/marble/src/plugins/render/weather/BBCWeatherItem.cpp #1015166:1015167
@@ -81,7 +81,12 @@
}
QUrl BBCWeatherItem::forecastUrl() const
- {
+{
return QUrl( QString( "http://newsrss.bbc.co.uk/weather/forecast/%1/Next3DaysRSS.xml" )
.arg( QString::number( bbcId() ) ) );
}
+
+QString BBCWeatherItem::creditHtml() const
+{
+ return tr( "Supported by <a href=\"http://backstage.bbc.co.uk\" target=\"_BLANK\">backstage.bbc.co.uk</a>.<br>Weather data from UK MET Office" );
+}
--- trunk/KDE/kdeedu/marble/src/plugins/render/weather/BBCWeatherItem.h #1015166:1015167
@@ -35,6 +35,8 @@
quint32 bbcId() const;
void setBbcId( quint32 id );
+
+ QString creditHtml() const;
private:
quint32 m_bbcId;
bool m_observationRequested;
--- trunk/KDE/kdeedu/marble/src/plugins/render/weather/WeatherItem.cpp #1015166:1015167
@@ -420,6 +420,11 @@
d->m_priority = priority;
}
+QString WeatherItem::creditHtml() const
+{
+ return QString();
+}
+
void WeatherItem::setSettings( QHash<QString, QVariant> settings )
{
if ( d->m_settings == settings ) {
@@ -457,6 +462,12 @@
d->speedUnit(),
d->pressureUnit() );
}
+ QString credit = creditHtml();
+ if ( !credit.isEmpty() ) {
+ html += "<p>";
+ html += creditHtml();
+ html += "</p>";
+ }
html += "</body>";
html += "</html>";
--- trunk/KDE/kdeedu/marble/src/plugins/render/weather/WeatherItem.h #1015166:1015167
@@ -80,6 +80,8 @@
quint8 priority() const;
void setPriority( quint8 priority );
+ virtual QString creditHtml() const;
+
void setSettings( QHash<QString, QVariant> settings );
public Q_SLOTS:
More information about the Marble-commits
mailing list