summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2014-05-10 23:37:03 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-05-10 23:44:28 +0900
commitb156b600fa32a4fa58f2e0bbd8e41079b8ec6527 (patch)
treea9aeb5b53cf982755c5e7951c9991afa5065da7a
parent173930811883621143f40f74ad57db8c3b9ea859 (diff)
list: initialize some internal variables on item free not item del pre.
This fixes variable initialize problems related to focus. This can be reproduced when you enable focus highlight/animation and reuse elm_list by clearing it. This problem occurred because list item del pre is never been called. This bug will be addressed in a next commit.
-rw-r--r--src/lib/elm_list.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c
index 050897871..dedc4a1f5 100644
--- a/src/lib/elm_list.c
+++ b/src/lib/elm_list.c
@@ -73,6 +73,18 @@ static const Elm_Action key_actions[] = {
73static inline void 73static inline void
74_elm_list_item_free(Elm_List_Item *it) 74_elm_list_item_free(Elm_List_Item *it)
75{ 75{
76 ELM_LIST_DATA_GET(WIDGET(it), sd);
77
78 if (sd->focused_item == (Elm_Object_Item *)it)
79 sd->focused_item = NULL;
80 if (sd->last_focused_item == (Elm_Object_Item *)it)
81 sd->last_focused_item = NULL;
82 if (sd->prev_focused_item == (Elm_Object_Item *)it)
83 sd->prev_focused_item = NULL;
84 if (sd->last_selected_item == (Elm_Object_Item *)it)
85 sd->last_selected_item = NULL;
86
87
76 evas_object_event_callback_del_full 88 evas_object_event_callback_del_full
77 (VIEW(it), EVAS_CALLBACK_MOUSE_DOWN, _mouse_down_cb, it); 89 (VIEW(it), EVAS_CALLBACK_MOUSE_DOWN, _mouse_down_cb, it);
78 evas_object_event_callback_del_full 90 evas_object_event_callback_del_full
@@ -1881,15 +1893,6 @@ _item_del_pre_hook(Elm_Object_Item *it)
1881 1893
1882 sd->items = eina_list_remove_list(sd->items, item->node); 1894 sd->items = eina_list_remove_list(sd->items, item->node);
1883 1895
1884 if (sd->focused_item == (Elm_Object_Item *)it)
1885 sd->focused_item = NULL;
1886 if (sd->last_focused_item == (Elm_Object_Item *)it)
1887 sd->last_focused_item = NULL;
1888 if (sd->prev_focused_item == (Elm_Object_Item *)it)
1889 sd->prev_focused_item = NULL;
1890 if (sd->last_selected_item == (Elm_Object_Item *)it)
1891 sd->last_selected_item = NULL;
1892
1893 evas_object_ref(obj); 1896 evas_object_ref(obj);
1894 _elm_list_walk(sd); 1897 _elm_list_walk(sd);
1895 1898