Files
QtZeiterfassung/plugins/weatherplugin/weathersettings.cpp
T

22 lines
570 B
C++
Raw Normal View History

2018-03-11 13:39:38 +01:00
#include "weathersettings.h"
2018-03-11 14:46:34 +01:00
#include "zeiterfassungsettings.h"
2018-03-11 13:39:38 +01:00
2018-03-11 14:46:34 +01:00
WeatherSettings::WeatherSettings(ZeiterfassungSettings &settings) :
m_settings(settings)
2018-03-11 13:39:38 +01:00
{
}
2018-03-11 14:46:34 +01:00
QUrl WeatherSettings::url() const
2018-03-11 14:21:43 +01:00
{
2018-03-11 14:46:34 +01:00
return m_settings.value(QStringLiteral("WeatherPlugin/url"),
QUrl(QStringLiteral("http://api.openweathermap.org/data/2.5/weather?q=Graz,AT&units=metric&APPID=40f6c892c6162680c6c9235169dc9f83")))
.toUrl();
2018-03-11 14:21:43 +01:00
}
2018-03-11 14:46:34 +01:00
void WeatherSettings::setUrl(const QUrl &url)
2018-03-11 13:39:38 +01:00
{
2018-03-11 14:46:34 +01:00
m_settings.setValue(QStringLiteral("WeatherPlugin/url"), url);
2018-03-11 13:39:38 +01:00
}