hermet pushed a commit to branch elementary-1.15.

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

commit fee7c5d93369fd6d59d3f95d9204e83644ea488f
Author: Andrii Kroitor <an.kroi...@samsung.com>
Date:   Fri Aug 28 20:18:23 2015 +0900

    elm_genlist: fix sub-items prepending
    
    Summary:
    fix sub-item position after prepending if parent item has no other
    sub-items
    
    Test Plan:
    1. add genlist
    2. add parent item
    3. compare results of following actions:
     case 1: append sub-item "child1" and then prepend sub-item "child2"
     case 2: prepend sub-item "child2" and then append sub-item "child1"
    
    ExR results are the same
    CuR in case 2 sub-items are placed in wrong position
    
    Reviewers: cedric, raster, reutskiy.v.v, SanghyeonLee, Hermet
    
    Reviewed By: Hermet
    
    Differential Revision: https://phab.enlightenment.org/D2965
---
 src/lib/elm_genlist.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index 48f5554..22b5de1 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -6117,6 +6117,9 @@ _elm_genlist_item_prepend(Eo *obj EINA_UNUSED, 
Elm_Genlist_Data *sd, const Elm_G
         ELM_GENLIST_ITEM_DATA_GET(eo_parent, parent);
         ELM_GENLIST_ITEM_CHECK_OR_RETURN(parent, NULL);
         EINA_SAFETY_ON_FALSE_RETURN_VAL((obj == WIDGET(parent)), NULL);
+        /* first sub-item should allways be appended */
+        if (!parent->item->items)
+          return _elm_genlist_item_append(obj, sd, itc, data, eo_parent, type, 
func, func_data);
      }
 
    it = _elm_genlist_item_new

-- 


Reply via email to