forked from enlightenment/efl
elm_entry.c: ELM_SAFE_FREE adoption.
I splited ELM_SAFE_FREE refactoring patches. One commit per each file as recommended. For the detail, please refer 3072dab12f12fe83fb5a628d15efd5cded11787f.
This commit is contained in:
parent
b54fb12f8b
commit
742fa688d8
|
@ -1382,7 +1382,7 @@ _mouse_down_cb(void *data,
|
||||||
sd->downy = ev->canvas.y;
|
sd->downy = ev->canvas.y;
|
||||||
if (ev->button == 1)
|
if (ev->button == 1)
|
||||||
{
|
{
|
||||||
ELM_FREE_FUNC(sd->longpress_timer, ecore_timer_del);
|
if (sd->longpress_timer) ecore_timer_del(sd->longpress_timer);
|
||||||
sd->longpress_timer = ecore_timer_add
|
sd->longpress_timer = ecore_timer_add
|
||||||
(_elm_config->longpress_timeout, _long_press_cb, data);
|
(_elm_config->longpress_timeout, _long_press_cb, data);
|
||||||
}
|
}
|
||||||
|
@ -1406,7 +1406,7 @@ _mouse_up_cb(void *data,
|
||||||
if (sd->disabled) return;
|
if (sd->disabled) return;
|
||||||
if (ev->button == 1)
|
if (ev->button == 1)
|
||||||
{
|
{
|
||||||
ELM_FREE_FUNC(sd->longpress_timer, ecore_timer_del);
|
ELM_SAFE_FREE(sd->longpress_timer, ecore_timer_del);
|
||||||
}
|
}
|
||||||
else if ((ev->button == 3) && (!_elm_config->desktop_entry))
|
else if ((ev->button == 3) && (!_elm_config->desktop_entry))
|
||||||
{
|
{
|
||||||
|
@ -1430,7 +1430,7 @@ _mouse_move_cb(void *data,
|
||||||
{
|
{
|
||||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
|
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
|
||||||
{
|
{
|
||||||
ELM_FREE_FUNC(sd->longpress_timer, ecore_timer_del);
|
ELM_SAFE_FREE(sd->longpress_timer, ecore_timer_del);
|
||||||
}
|
}
|
||||||
else if (sd->longpress_timer)
|
else if (sd->longpress_timer)
|
||||||
{
|
{
|
||||||
|
@ -1444,7 +1444,7 @@ _mouse_move_cb(void *data,
|
||||||
((_elm_config->finger_size / 2) *
|
((_elm_config->finger_size / 2) *
|
||||||
(_elm_config->finger_size / 2)))
|
(_elm_config->finger_size / 2)))
|
||||||
{
|
{
|
||||||
ELM_FREE_FUNC(sd->longpress_timer, ecore_timer_del);
|
ELM_SAFE_FREE(sd->longpress_timer, ecore_timer_del);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1460,7 +1460,7 @@ _mouse_move_cb(void *data,
|
||||||
((_elm_config->finger_size / 2) *
|
((_elm_config->finger_size / 2) *
|
||||||
(_elm_config->finger_size / 2)))
|
(_elm_config->finger_size / 2)))
|
||||||
{
|
{
|
||||||
ELM_FREE_FUNC(sd->longpress_timer, ecore_timer_del);
|
ELM_SAFE_FREE(sd->longpress_timer, ecore_timer_del);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1483,9 +1483,8 @@ _entry_changed_handle(void *data,
|
||||||
evas_object_size_hint_min_set(data, -1, minh);
|
evas_object_size_hint_min_set(data, -1, minh);
|
||||||
|
|
||||||
elm_layout_sizing_eval(data);
|
elm_layout_sizing_eval(data);
|
||||||
if (sd->text) eina_stringshare_del(sd->text);
|
ELM_SAFE_FREE(sd->text, eina_stringshare_del);
|
||||||
sd->text = NULL;
|
ELM_SAFE_FREE(sd->delay_write, ecore_timer_del);
|
||||||
ELM_FREE_FUNC(sd->delay_write, ecore_timer_del);
|
|
||||||
evas_event_thaw(evas_object_evas_get(data));
|
evas_event_thaw(evas_object_evas_get(data));
|
||||||
evas_event_thaw_eval(evas_object_evas_get(data));
|
evas_event_thaw_eval(evas_object_evas_get(data));
|
||||||
if ((sd->auto_save) && (sd->file))
|
if ((sd->auto_save) && (sd->file))
|
||||||
|
@ -2229,8 +2228,7 @@ _text_append_idler(void *data)
|
||||||
ELM_ENTRY_DATA_GET(obj, sd);
|
ELM_ENTRY_DATA_GET(obj, sd);
|
||||||
|
|
||||||
evas_event_freeze(evas_object_evas_get(obj));
|
evas_event_freeze(evas_object_evas_get(obj));
|
||||||
if (sd->text) eina_stringshare_del(sd->text);
|
ELM_SAFE_FREE(sd->text, eina_stringshare_del);
|
||||||
sd->text = NULL;
|
|
||||||
sd->changed = EINA_TRUE;
|
sd->changed = EINA_TRUE;
|
||||||
|
|
||||||
start = sd->append_text_position;
|
start = sd->append_text_position;
|
||||||
|
@ -2533,8 +2531,7 @@ _elm_entry_smart_text_set(Eo *obj, void *_pd, va_list *list)
|
||||||
}
|
}
|
||||||
|
|
||||||
evas_event_freeze(evas_object_evas_get(obj));
|
evas_event_freeze(evas_object_evas_get(obj));
|
||||||
if (sd->text) eina_stringshare_del(sd->text);
|
ELM_SAFE_FREE(sd->text, eina_stringshare_del);
|
||||||
sd->text = NULL;
|
|
||||||
sd->changed = EINA_TRUE;
|
sd->changed = EINA_TRUE;
|
||||||
|
|
||||||
/* Clear currently pending job if there is one */
|
/* Clear currently pending job if there is one */
|
||||||
|
@ -2961,7 +2958,7 @@ _elm_entry_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
|
||||||
|
|
||||||
if (sd->delay_write)
|
if (sd->delay_write)
|
||||||
{
|
{
|
||||||
ELM_FREE_FUNC(sd->delay_write, ecore_timer_del);
|
if (sd->delay_write) ecore_timer_del(sd->delay_write);
|
||||||
if (sd->auto_save) _save_do(obj);
|
if (sd->auto_save) _save_do(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2994,7 +2991,7 @@ _elm_entry_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
|
||||||
sd->append_text_left = NULL;
|
sd->append_text_left = NULL;
|
||||||
sd->append_text_idler = NULL;
|
sd->append_text_idler = NULL;
|
||||||
}
|
}
|
||||||
ELM_FREE_FUNC(sd->longpress_timer, ecore_timer_del);
|
if (sd->longpress_timer) ecore_timer_del(sd->longpress_timer);
|
||||||
EINA_LIST_FREE(sd->items, it)
|
EINA_LIST_FREE(sd->items, it)
|
||||||
{
|
{
|
||||||
eina_stringshare_del(it->label);
|
eina_stringshare_del(it->label);
|
||||||
|
@ -3010,9 +3007,9 @@ _elm_entry_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
|
||||||
{
|
{
|
||||||
_filter_free(tf);
|
_filter_free(tf);
|
||||||
}
|
}
|
||||||
ELM_FREE_FUNC(sd->delay_write, ecore_timer_del);
|
if (sd->delay_write) ecore_timer_del(sd->delay_write);
|
||||||
ELM_FREE_FUNC(sd->input_panel_imdata, free);
|
if (sd->input_panel_imdata) free(sd->input_panel_imdata);
|
||||||
ELM_FREE_FUNC(sd->anchor_hover.hover_style, eina_stringshare_del);
|
if (sd->anchor_hover.hover_style) eina_stringshare_del(sd->anchor_hover.hover_style);
|
||||||
|
|
||||||
evas_event_thaw(evas_object_evas_get(obj));
|
evas_event_thaw(evas_object_evas_get(obj));
|
||||||
evas_event_thaw_eval(evas_object_evas_get(obj));
|
evas_event_thaw_eval(evas_object_evas_get(obj));
|
||||||
|
@ -4395,7 +4392,7 @@ _file_set(Eo *obj, void *_pd, va_list *list)
|
||||||
|
|
||||||
Elm_Entry_Smart_Data *sd = _pd;
|
Elm_Entry_Smart_Data *sd = _pd;
|
||||||
|
|
||||||
ELM_FREE_FUNC(sd->delay_write, ecore_timer_del);
|
ELM_SAFE_FREE(sd->delay_write, ecore_timer_del);
|
||||||
if (sd->auto_save) _save_do(obj);
|
if (sd->auto_save) _save_do(obj);
|
||||||
eina_stringshare_replace(&sd->file, file);
|
eina_stringshare_replace(&sd->file, file);
|
||||||
sd->format = format;
|
sd->format = format;
|
||||||
|
@ -4435,7 +4432,7 @@ _file_save(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
|
||||||
{
|
{
|
||||||
Elm_Entry_Smart_Data *sd = _pd;
|
Elm_Entry_Smart_Data *sd = _pd;
|
||||||
|
|
||||||
ELM_FREE_FUNC(sd->delay_write, ecore_timer_del);
|
ELM_SAFE_FREE(sd->delay_write, ecore_timer_del);
|
||||||
_save_do(obj);
|
_save_do(obj);
|
||||||
sd->delay_write = ecore_timer_add(2.0, _delay_write, obj);
|
sd->delay_write = ecore_timer_add(2.0, _delay_write, obj);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue