From: seoz Date: Thu, 13 Oct 2011 03:47:57 +0000 (+0000) Subject: elm genlist: Clear last_selected_item when last_selected_item is X-Git-Tag: REL_F_I9500_20120323_1~17^2~1638 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0cd3d6f3684e36add6040c588957e78628cb72de;p=framework%2Fuifw%2Felementary.git elm genlist: Clear last_selected_item when last_selected_item is deleted. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@64031 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c index 574443a..f91b1ab 100644 --- a/src/lib/elm_genlist.c +++ b/src/lib/elm_genlist.c @@ -1702,6 +1702,15 @@ _item_label_hook(Elm_Genlist_Item *it, const char *part) } static void +_item_del_hook(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) +{ + Elm_Genlist_Item *it = event_info; + if (!it) return; + if (it->wd->last_selected_item == it) + it->wd->last_selected_item = NULL; +} + +static void _item_label_realize(Elm_Genlist_Item *it, Evas_Object *target, Eina_List **source) @@ -3158,6 +3167,7 @@ _item_new(Widget_Data *wd, it->mouse_cursor = NULL; it->expanded_depth = 0; elm_widget_item_text_get_hook_set(it, _item_label_hook); + elm_widget_item_del_cb_set(it, _item_del_hook); if (it->parent) {