|
|
|
@ -10,7 +10,7 @@ char *strptime(const char *s, const char *format, struct tm *tm); |
|
|
|
|
|
|
|
|
|
#define GOLDEN_RATIO 1.618033989 |
|
|
|
|
|
|
|
|
|
#define ENABLE_DEBUG 0 |
|
|
|
|
#define ENABLE_DEBUG 1 |
|
|
|
|
#define DEBUG(f, ...) if (ENABLE_DEBUG) \ |
|
|
|
|
printf("[forecasts] "f "\n", __VA_ARGS__) |
|
|
|
|
|
|
|
|
@ -369,6 +369,9 @@ E_API E_Module_Api e_modapi = { |
|
|
|
|
E_API void * |
|
|
|
|
e_modapi_init(E_Module *m) |
|
|
|
|
{ |
|
|
|
|
Eina_List *l; |
|
|
|
|
Config_Item *ci; |
|
|
|
|
|
|
|
|
|
ecore_con_url_init(); |
|
|
|
|
bindtextdomain(PACKAGE, LOCALE_DIR); |
|
|
|
|
bind_textdomain_codeset(PACKAGE, "UTF-8"); |
|
|
|
@ -398,8 +401,6 @@ e_modapi_init(E_Module *m) |
|
|
|
|
forecasts_config = e_config_domain_load("module.forecasts", conf_edd); |
|
|
|
|
if (!forecasts_config) |
|
|
|
|
{ |
|
|
|
|
Config_Item *ci; |
|
|
|
|
|
|
|
|
|
forecasts_config = E_NEW(Config, 1); |
|
|
|
|
|
|
|
|
|
ci = E_NEW(Config_Item, 1); |
|
|
|
@ -412,6 +413,11 @@ e_modapi_init(E_Module *m) |
|
|
|
|
|
|
|
|
|
forecasts_config->items = eina_list_append(forecasts_config->items, ci); |
|
|
|
|
} |
|
|
|
|
EINA_LIST_FOREACH(forecasts_config->items, l, ci) |
|
|
|
|
{ |
|
|
|
|
if (ci->poll_time < 60.0) ci->poll_time = 60.0; |
|
|
|
|
else if (ci->poll_time > 3600.0) ci->poll_time = 3600.0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
forecasts_config->module = m; |
|
|
|
|
e_gadcon_provider_register(&_gadcon_class); |
|
|
|
@ -895,13 +901,10 @@ _forecasts_config_updated(Config_Item *ci) |
|
|
|
|
|
|
|
|
|
if (area_changed) |
|
|
|
|
_forecasts_cb_check(inst); |
|
|
|
|
if (!inst->check_timer) |
|
|
|
|
inst->check_timer = |
|
|
|
|
ecore_timer_add(inst->ci->poll_time, _forecasts_cb_check, |
|
|
|
|
inst); |
|
|
|
|
else |
|
|
|
|
ecore_timer_interval_set(inst->check_timer, |
|
|
|
|
inst->ci->poll_time); |
|
|
|
|
if (inst->check_timer) ecore_timer_del(inst->check_timer); |
|
|
|
|
inst->check_timer = |
|
|
|
|
ecore_timer_add(inst->ci->poll_time, _forecasts_cb_check, |
|
|
|
|
inst); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|