genlist: fix genlist item prepend to below the group parent 08/130608/2
authorSangHyeon Lee <sh10233.lee@samsung.com>
Tue, 23 May 2017 06:10:43 +0000 (15:10 +0900)
committerSangHyeon Lee <sh10233.lee@samsung.com>
Tue, 30 May 2017 04:49:30 +0000 (04:49 +0000)
Change-Id: I62a08d5730882e0490a3060735afeaffec6284ef
Signed-off-by: SangHyeon Lee <sh10233.lee@samsung.com>
src/mobile_lib/elm_genlist.c

index 17de5a9..379c09b 100644 (file)
@@ -6735,6 +6735,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
        (sd, itc, data, eo_parent, type, func, func_data);