diff options
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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; } |