- weather: better naming for update cycle

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2019-03-20 17:01:39 +01:00
committed by Thilo Graf
parent f8e0bf244a
commit 7fedf87ea6

View File

@@ -40,7 +40,7 @@
#include "weather.h" #include "weather.h"
#define MINUTES 15*60 #define UPDATE_CYCLE 15 // minutes
CWeather* CWeather::getInstance() CWeather* CWeather::getInstance()
{ {
@@ -81,7 +81,7 @@ void CWeather::setCoords(std::string new_coords, std::string new_city)
bool CWeather::checkUpdate(bool forceUpdate) bool CWeather::checkUpdate(bool forceUpdate)
{ {
time_t current_time = time(NULL); time_t current_time = time(NULL);
if (forceUpdate || (difftime(current_time,last_time) > MINUTES)) if (forceUpdate || (difftime(current_time, last_time) > (UPDATE_CYCLE * 60)))
return GetWeatherDetails(); return GetWeatherDetails();
else else
return false; return false;