seriously, it sometimes might be worth at least *reading* what code
does, this was initializating a private data struct on one single global
boolean flag. How was that ever intended to work ? How could that ever
slip through review ?
This is not the only madness in these widget arround time and date, you
cannot even select hours in 24h mode, you also cannot cannot select the
0 hour, which is kind of normal for the one or another region? the
datetimemanager (which is IMO a complete misconcept) is full of FIXMEs
and API calls that are defined and never called at all. Again what is
this ? And how did that ever get into the codebase ?!
With this commit the widget *finally* can be created more than once
without exploding and erroring one.
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10843
{
Efl_Time time;
char format[MAX_FORMAT_LEN];
+ Eina_Bool init;
} Efl_Datetime_Manager_Data;
-Eina_Bool init = EINA_FALSE;
-
static void
_time_init(Efl_Time *curr_time)
{
t = time(NULL);
localtime_r(&t, curr_time);
-
- init = EINA_TRUE;
}
static char *
EOLIAN static Efl_Time
_efl_datetime_manager_value_get(const Eo *obj EINA_UNUSED, Efl_Datetime_Manager_Data *pd)
{
- if (!init) _time_init(&pd->time);
+ if (!pd->init) _time_init(&pd->time);
+ pd->init = EINA_TRUE;
return pd->time;
}
}
EFL_END_TEST
+
+EFL_START_TEST(no_err_on_creation)
+{
+ widget = efl_add(widget_klass, win);
+}
+EFL_END_TEST
+
EFL_START_TEST(no_err_on_shutdown)
{
efl_ref(widget);
tcase_add_test(tc, no_leaking_canvas_object);
tcase_add_test(tc, no_err_on_shutdown);
tcase_add_test(tc, correct_visibility_setting);
+ tcase_add_test(tc, no_err_on_creation);
}