summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'config.c')
-rw-r--r--config.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/config.c b/config.c
index e7b2293..3762b9d 100644
--- a/config.c
+++ b/config.c
@@ -3,11 +3,15 @@
cWeatherforecastConfig::cWeatherforecastConfig() {
//number of hours to wait till next update from forecast.io is fetched
hoursToUpdate = 20;
+ //if own API Key is set, user can configure its own udate frequence
+ userHoursToUpdate = 0;
//city to display in menus
city = "";
//latitude and longitude of location for forecast.io query
lat = 0.0;
lon = 0.0;
+ //User can configure individual API Key
+ userApiKey = "";
}
cWeatherforecastConfig::~cWeatherforecastConfig() {
@@ -17,6 +21,8 @@ bool cWeatherforecastConfig::SetupParse(const char *Name, const char *Value) {
if (!strcasecmp(Name, "city")) city = Value;
else if (!strcasecmp(Name, "lat")) lat = atod(Value);
else if (!strcasecmp(Name, "lon")) lon = atod(Value);
+ else if (!strcasecmp(Name, "userapikey")) userApiKey = Value;
+ else if (!strcasecmp(Name, "updatefreq")) userHoursToUpdate = atoi(Value);
else return false;
return true;
}