ajwillia-ms pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=9c3aeec10fc9ac45776bf43509ce9e97b635c818

commit 9c3aeec10fc9ac45776bf43509ce9e97b635c818
Author: Andy Williams <[email protected]>
Date:   Sat Feb 15 20:23:18 2014 +0000

    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
---
 AUTHORS               |  1 +
 src/lib/elm_genlist.c | 25 ++++++++++++++++++++++++-
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/AUTHORS b/AUTHORS
index c19025f..8ea8b47 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -89,3 +89,4 @@ Anil Kumar Nahak <[email protected]>
 Michal Jagiello <[email protected]>
 Chinmaya Panigrahi <[email protected]>
 Mohammad Irfan <[email protected]>
+ajwillia.ms (Andrew Williams) <[email protected]>
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index f9a2436..4dbda67 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -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 =

-- 


Reply via email to