Fix issue where items added into tree with more than 2 levels could be rendered at the wrong location in the list.

Fix this by ensuring items are attached after all items below the current node rather than only below those at the current level of children
This commit is contained in:
Andy Williams 2014-02-15 20:23:18 +00:00
parent 4c0f458f25
commit d1534e4aa9
2 changed files with 25 additions and 1 deletions

View File

@ -89,3 +89,4 @@ Anil Kumar Nahak <ak.nahak@samsung.com>
Michal Jagiello <m.jagiello@samsung.com>
Chinmaya Panigrahi <c.panigrahi@samsung.com>
Mohammad Irfan <mohammad.i@samsung.com>
ajwillia.ms (Andrew Williams) <andy@andywilliams.me>

View File

@ -5448,6 +5448,29 @@ elm_genlist_item_append(Evas_Object *obj,
return ret;
}
static Eina_List *
_list_last_recursive(Eina_List *list)
{
Eina_List *ll, *ll2;
Elm_Gen_Item *it2;
ll = eina_list_last(list);
if (!ll) return NULL;
it2 = ll->data;
if (it2->item->items)
{
ll2 = _list_last_recursive(it2->item->items);
if (ll2)
{
return ll2;
}
}
return ll;
}
static void
_item_append(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
@ -5477,7 +5500,7 @@ _item_append(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
else
{
Elm_Gen_Item *it2 = NULL;
Eina_List *ll = eina_list_last(it->parent->item->items);
Eina_List *ll = _list_last_recursive(it->parent->item->items);
if (ll) it2 = ll->data;
it->parent->item->items =