This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository enlightenment-module-forecasts.
View the commit online.
commit 62747aa7aea71bb1ba36b26c444193fb7083a5be
Author: Alastair Poole <[email protected]>
AuthorDate: Mon May 25 12:08:00 2026 +0100
timer: remove hack.
We update every poll minutes there's no need for this.
---
src/e_mod_main.c | 70 --------------------------------------------------------
1 file changed, 70 deletions(-)
diff --git a/src/e_mod_main.c b/src/e_mod_main.c
index a772a23..089df72 100644
--- a/src/e_mod_main.c
+++ b/src/e_mod_main.c
@@ -49,7 +49,6 @@ struct _Instance
Evas_Object *forecasts_obj;
Forecasts *forecasts;
Ecore_Timer *check_timer;
- Ecore_Timer *midnight_timer;
Ecore_Con_Url *url;
Ecore_Event_Handler *url_data_handler;
Ecore_Event_Handler *url_complete_handler;
@@ -116,8 +115,6 @@ static void _forecasts_menu_cb_configure(void *data, E_Menu *m,
E_Menu_Item *mi);
static void _forecasts_menu_cb_post(void *data, E_Menu *m);
static Eina_Bool _forecasts_cb_check(void *data);
-static Eina_Bool _forecasts_cb_midnight(void *data);
-static void _forecasts_midnight_timer_reset(Instance *inst);
static Eina_Bool _forecasts_clock_timer_cb(void *data);
static void _forecasts_clock_timer_reset(void);
static Config_Item *_forecasts_config_item_get(const char *id);
@@ -138,7 +135,6 @@ static Evas_Object *_forecasts_popup_icon_create(Evas *evas, const char *code);
static void _forecasts_popup_destroy(Instance *inst);
static void _forecasts_popup_del_cb(void *obj);
static Eina_Bool _forecasts_time_local_get(const char *timezone, time_t t, struct tm *tm_out);
-static time_t _forecasts_time_mktime(const char *timezone, struct tm *tm_in);
static void _forecasts_location_time_text_get(Instance *inst, char *buf, size_t len,
Eina_Bool include_date);
static time_t _forecasts_timestamp_utc(const char *timestamp);
@@ -201,7 +197,6 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
_forecasts_cb_check(inst);
inst->check_timer =
ecore_timer_add(inst->ci->poll_time, _forecasts_cb_check, inst);
- _forecasts_midnight_timer_reset(inst);
return gcc;
}
@@ -217,8 +212,6 @@ _gc_shutdown(E_Gadcon_Client *gcc)
if (inst->popup) _forecasts_popup_destroy(inst);
if (inst->check_timer)
ecore_timer_del(inst->check_timer);
- if (inst->midnight_timer)
- ecore_timer_del(inst->midnight_timer);
if (inst->url_data_handler)
ecore_event_handler_del(inst->url_data_handler);
if (inst->url_complete_handler)
@@ -601,51 +594,6 @@ _forecasts_cb_check(void *data)
return EINA_TRUE;
}
-static Eina_Bool
-_forecasts_cb_midnight(void *data)
-{
- Instance *inst = data;
-
- if (!inst) return ECORE_CALLBACK_CANCEL;
-
- inst->midnight_timer = NULL;
- _forecasts_cb_check(inst);
- _forecasts_midnight_timer_reset(inst);
- return ECORE_CALLBACK_CANCEL;
-}
-
-static void
-_forecasts_midnight_timer_reset(Instance *inst)
-{
- time_t now, next;
- struct tm tm_next;
- double delay;
-
- if (!inst) return;
-
- if (inst->midnight_timer)
- {
- ecore_timer_del(inst->midnight_timer);
- inst->midnight_timer = NULL;
- }
-
- now = time(NULL);
- if (!_forecasts_time_local_get(inst->ci->timezone, now, &tm_next)) return;
-
- tm_next.tm_mday += 1;
- tm_next.tm_hour = 0;
- tm_next.tm_min = 0;
- tm_next.tm_sec = 5;
- tm_next.tm_isdst = -1;
-
- next = _forecasts_time_mktime(inst->ci->timezone, &tm_next);
- if (next == (time_t)-1) return;
-
- delay = difftime(next, now);
- if (delay < 1.0) delay = 1.0;
- inst->midnight_timer = ecore_timer_add(delay, _forecasts_cb_midnight, inst);
-}
-
static Eina_Bool
_forecasts_clock_timer_cb(void *data EINA_UNUSED)
{
@@ -777,23 +725,6 @@ _forecasts_time_local_get(const char *timezone, time_t t, struct tm *tm_out)
return ok;
}
-static time_t
-_forecasts_time_mktime(const char *timezone, struct tm *tm_in)
-{
- char *old_tz = NULL;
- Eina_Bool had_old_tz = EINA_FALSE;
- Eina_Bool changed;
- time_t t;
-
- if (!tm_in) return (time_t)-1;
-
- changed = _forecasts_timezone_apply(timezone, &old_tz, &had_old_tz);
- t = mktime(tm_in);
- if (changed) _forecasts_timezone_restore(old_tz, had_old_tz);
-
- return t;
-}
-
static void
_forecasts_location_time_text_get(Instance *inst, char *buf, size_t len,
Eina_Bool include_date)
@@ -1423,7 +1354,6 @@ _forecasts_config_updated(Config_Item *ci)
inst->check_timer =
ecore_timer_add(inst->ci->poll_time, _forecasts_cb_check,
inst);
- _forecasts_midnight_timer_reset(inst);
}
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.