summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2014-03-09 02:55:35 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-03-09 02:57:09 +0900
commit8b1284d3f4b9768b74a6363e10cf2dc608d0956f (patch)
tree088869fac6d1cd8c89f0ba4f506964e46b231f3f /src/lib
parent37dd92109c08849d0dacc24e4bd6abb9a349b04e (diff)
list/genlist/gengrid: Clear some internal variables when an item is deleted.
Set last_selected_item, last_focused_item, focused_item to NULL when the item is deleted. For genlist and gengrid, clear them in del_not_serious.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/elm_gengrid.c4
-rw-r--r--src/lib/elm_genlist.c8
-rw-r--r--src/lib/elm_list.c7
3 files changed, 15 insertions, 4 deletions
diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c
index 6462ab3e9..9c09310a9 100644
--- a/src/lib/elm_gengrid.c
+++ b/src/lib/elm_gengrid.c
@@ -2028,6 +2028,8 @@ _elm_gengrid_item_del_not_serious(Elm_Gen_Item *it)
2028 2028
2029 if (it->selected) 2029 if (it->selected)
2030 sd->selected = eina_list_remove(sd->selected, it); 2030 sd->selected = eina_list_remove(sd->selected, it);
2031 if (sd->last_selected_item == (Elm_Object_Item *)it)
2032 sd->last_selected_item = NULL;
2031 2033
2032 if (it->itc->func.del) 2034 if (it->itc->func.del)
2033 it->itc->func.del((void *)it->base.data, WIDGET(it)); 2035 it->itc->func.del((void *)it->base.data, WIDGET(it));
@@ -2051,8 +2053,6 @@ _elm_gengrid_item_del_serious(Elm_Gen_Item *it)
2051 ecore_job_del(sd->calc_job); 2053 ecore_job_del(sd->calc_job);
2052 sd->calc_job = ecore_job_add(sd->calc_cb, sd->obj); 2054 sd->calc_job = ecore_job_add(sd->calc_cb, sd->obj);
2053 2055
2054 if (sd->last_selected_item == (Elm_Object_Item *)it)
2055 sd->last_selected_item = NULL;
2056 sd->item_count--; 2056 sd->item_count--;
2057 2057
2058 ELM_SAFE_FREE(it->item, free); 2058 ELM_SAFE_FREE(it->item, free);
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index ef5bd063d..893786158 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -3227,6 +3227,12 @@ _elm_genlist_item_del_not_serious(Elm_Gen_Item *it)
3227 3227
3228 if (it->selected) 3228 if (it->selected)
3229 sd->selected = eina_list_remove(sd->selected, it); 3229 sd->selected = eina_list_remove(sd->selected, it);
3230 if (sd->last_focused_item == (Elm_Object_Item *)it)
3231 sd->last_focused_item = NULL;
3232 if (sd->focused_item == (Elm_Object_Item *)it)
3233 sd->focused_item = NULL;
3234 if (sd->last_selected_item == (Elm_Object_Item *)it)
3235 sd->last_selected_item = NULL;
3230 3236
3231 if (it->itc->func.del) 3237 if (it->itc->func.del)
3232 it->itc->func.del((void *)it->base.data, WIDGET(it)); 3238 it->itc->func.del((void *)it->base.data, WIDGET(it));
@@ -3251,8 +3257,6 @@ _elm_genlist_item_del_serious(Elm_Gen_Item *it)
3251 ecore_job_del(sd->calc_job); 3257 ecore_job_del(sd->calc_job);
3252 sd->calc_job = ecore_job_add(_calc_job, sd->obj); 3258 sd->calc_job = ecore_job_add(_calc_job, sd->obj);
3253 3259
3254 if (sd->last_selected_item == (Elm_Object_Item *)it)
3255 sd->last_selected_item = NULL;
3256 sd->item_count--; 3260 sd->item_count--;
3257 3261
3258 ELM_SAFE_FREE(it->item, free); 3262 ELM_SAFE_FREE(it->item, free);
diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c
index 8df8f4844..3b0ddd1dc 100644
--- a/src/lib/elm_list.c
+++ b/src/lib/elm_list.c
@@ -1670,6 +1670,13 @@ _item_del_pre_hook(Elm_Object_Item *it)
1670 1670
1671 sd->items = eina_list_remove_list(sd->items, item->node); 1671 sd->items = eina_list_remove_list(sd->items, item->node);
1672 1672
1673 if (sd->focused_item == (Elm_Object_Item *)it)
1674 sd->focused_item = NULL;
1675 if (sd->last_focused_item == (Elm_Object_Item *)it)
1676 sd->last_focused_item = NULL;
1677 if (sd->last_selected_item == (Elm_Object_Item *)it)
1678 sd->last_selected_item = NULL;
1679
1673 evas_object_ref(obj); 1680 evas_object_ref(obj);
1674 _elm_list_walk(sd); 1681 _elm_list_walk(sd);
1675 1682