From b5969dc2a3f35352fad66ca7cf5fb1914a6022a8 Mon Sep 17 00:00:00 2001 From: Daniel Juyung Seo Date: Thu, 13 Oct 2011 03:47:57 +0000 Subject: [PATCH] elm genlist: Clear last_selected_item when last_selected_item is deleted. SVN revision: 64031 --- legacy/elementary/src/lib/elm_genlist.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/legacy/elementary/src/lib/elm_genlist.c b/legacy/elementary/src/lib/elm_genlist.c index 574443a2e9..f91b1abc25 100644 --- a/legacy/elementary/src/lib/elm_genlist.c +++ b/legacy/elementary/src/lib/elm_genlist.c @@ -1701,6 +1701,15 @@ _item_label_hook(Elm_Genlist_Item *it, const char *part) return edje_object_part_text_get(it->base.view, 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, @@ -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) {