mirror of https://github.com/sqfmi/Watchy.git
Use designated initialisers for watchySettings
This [0] allows to skip obsolete fields, and generally not have to rely on field ordering. [0] https://www.cppstories.com/2021/designated-init-cpp20/ Signed-off-by: Olivier Mehani <shtrom@ssji.net>pull/189/head
parent
99158e19d4
commit
b0e405e187
|
@ -13,14 +13,14 @@
|
||||||
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT
|
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT
|
||||||
|
|
||||||
watchySettings settings{
|
watchySettings settings{
|
||||||
CITY_ID,
|
.cityID = CITY_ID,
|
||||||
OPENWEATHERMAP_APIKEY,
|
.weatherAPIKey = OPENWEATHERMAP_APIKEY,
|
||||||
OPENWEATHERMAP_URL,
|
.weatherURL = OPENWEATHERMAP_URL,
|
||||||
TEMP_UNIT,
|
.weatherUnit = TEMP_UNIT,
|
||||||
TEMP_LANG,
|
.weatherLang = TEMP_LANG,
|
||||||
WEATHER_UPDATE_INTERVAL,
|
.weatherUpdateInterval = WEATHER_UPDATE_INTERVAL,
|
||||||
NTP_SERVER,
|
.ntpServer = NTP_SERVER,
|
||||||
GMT_OFFSET_SEC
|
.gmtOffset = GMT_OFFSET_SEC,
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -13,14 +13,14 @@
|
||||||
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT
|
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT
|
||||||
|
|
||||||
watchySettings settings{
|
watchySettings settings{
|
||||||
CITY_ID,
|
.cityID = CITY_ID,
|
||||||
OPENWEATHERMAP_APIKEY,
|
.weatherAPIKey = OPENWEATHERMAP_APIKEY,
|
||||||
OPENWEATHERMAP_URL,
|
.weatherURL = OPENWEATHERMAP_URL,
|
||||||
TEMP_UNIT,
|
.weatherUnit = TEMP_UNIT,
|
||||||
TEMP_LANG,
|
.weatherLang = TEMP_LANG,
|
||||||
WEATHER_UPDATE_INTERVAL,
|
.weatherUpdateInterval = WEATHER_UPDATE_INTERVAL,
|
||||||
NTP_SERVER,
|
.ntpServer = NTP_SERVER,
|
||||||
GMT_OFFSET_SEC
|
.gmtOffset = GMT_OFFSET_SEC,
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -13,14 +13,14 @@
|
||||||
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT
|
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT
|
||||||
|
|
||||||
watchySettings settings{
|
watchySettings settings{
|
||||||
CITY_ID,
|
.cityID = CITY_ID,
|
||||||
OPENWEATHERMAP_APIKEY,
|
.weatherAPIKey = OPENWEATHERMAP_APIKEY,
|
||||||
OPENWEATHERMAP_URL,
|
.weatherURL = OPENWEATHERMAP_URL,
|
||||||
TEMP_UNIT,
|
.weatherUnit = TEMP_UNIT,
|
||||||
TEMP_LANG,
|
.weatherLang = TEMP_LANG,
|
||||||
WEATHER_UPDATE_INTERVAL,
|
.weatherUpdateInterval = WEATHER_UPDATE_INTERVAL,
|
||||||
NTP_SERVER,
|
.ntpServer = NTP_SERVER,
|
||||||
GMT_OFFSET_SEC
|
.gmtOffset = GMT_OFFSET_SEC,
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -13,14 +13,14 @@
|
||||||
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT
|
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT
|
||||||
|
|
||||||
watchySettings settings{
|
watchySettings settings{
|
||||||
CITY_ID,
|
.cityID = CITY_ID,
|
||||||
OPENWEATHERMAP_APIKEY,
|
.weatherAPIKey = OPENWEATHERMAP_APIKEY,
|
||||||
OPENWEATHERMAP_URL,
|
.weatherURL = OPENWEATHERMAP_URL,
|
||||||
TEMP_UNIT,
|
.weatherUnit = TEMP_UNIT,
|
||||||
TEMP_LANG,
|
.weatherLang = TEMP_LANG,
|
||||||
WEATHER_UPDATE_INTERVAL,
|
.weatherUpdateInterval = WEATHER_UPDATE_INTERVAL,
|
||||||
NTP_SERVER,
|
.ntpServer = NTP_SERVER,
|
||||||
GMT_OFFSET_SEC
|
.gmtOffset = GMT_OFFSET_SEC,
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -13,14 +13,14 @@
|
||||||
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT
|
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT
|
||||||
|
|
||||||
watchySettings settings{
|
watchySettings settings{
|
||||||
CITY_ID,
|
.cityID = CITY_ID,
|
||||||
OPENWEATHERMAP_APIKEY,
|
.weatherAPIKey = OPENWEATHERMAP_APIKEY,
|
||||||
OPENWEATHERMAP_URL,
|
.weatherURL = OPENWEATHERMAP_URL,
|
||||||
TEMP_UNIT,
|
.weatherUnit = TEMP_UNIT,
|
||||||
TEMP_LANG,
|
.weatherLang = TEMP_LANG,
|
||||||
WEATHER_UPDATE_INTERVAL,
|
.weatherUpdateInterval = WEATHER_UPDATE_INTERVAL,
|
||||||
NTP_SERVER,
|
.ntpServer = NTP_SERVER,
|
||||||
GMT_OFFSET_SEC
|
.gmtOffset = GMT_OFFSET_SEC,
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -13,14 +13,14 @@
|
||||||
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT
|
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT
|
||||||
|
|
||||||
watchySettings settings{
|
watchySettings settings{
|
||||||
CITY_ID,
|
.cityID = CITY_ID,
|
||||||
OPENWEATHERMAP_APIKEY,
|
.weatherAPIKey = OPENWEATHERMAP_APIKEY,
|
||||||
OPENWEATHERMAP_URL,
|
.weatherURL = OPENWEATHERMAP_URL,
|
||||||
TEMP_UNIT,
|
.weatherUnit = TEMP_UNIT,
|
||||||
TEMP_LANG,
|
.weatherLang = TEMP_LANG,
|
||||||
WEATHER_UPDATE_INTERVAL,
|
.weatherUpdateInterval = WEATHER_UPDATE_INTERVAL,
|
||||||
NTP_SERVER,
|
.ntpServer = NTP_SERVER,
|
||||||
GMT_OFFSET_SEC
|
.gmtOffset = GMT_OFFSET_SEC,
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -13,14 +13,14 @@
|
||||||
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT
|
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT
|
||||||
|
|
||||||
watchySettings settings{
|
watchySettings settings{
|
||||||
CITY_ID,
|
.cityID = CITY_ID,
|
||||||
OPENWEATHERMAP_APIKEY,
|
.weatherAPIKey = OPENWEATHERMAP_APIKEY,
|
||||||
OPENWEATHERMAP_URL,
|
.weatherURL = OPENWEATHERMAP_URL,
|
||||||
TEMP_UNIT,
|
.weatherUnit = TEMP_UNIT,
|
||||||
TEMP_LANG,
|
.weatherLang = TEMP_LANG,
|
||||||
WEATHER_UPDATE_INTERVAL,
|
.weatherUpdateInterval = WEATHER_UPDATE_INTERVAL,
|
||||||
NTP_SERVER,
|
.ntpServer = NTP_SERVER,
|
||||||
GMT_OFFSET_SEC
|
.gmtOffset = GMT_OFFSET_SEC,
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
Loading…
Reference in New Issue