[Genlist] Applied upstream patch r62645.
authorseoz <seoz@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 21 Aug 2011 05:27:19 +0000 (05:27 +0000)
committerDaniel Juyung Seo <juyung.seo@samsung.com>
Wed, 24 Aug 2011 05:53:51 +0000 (14:53 +0900)
elm genlist: Fixed elm_genlist_item_insert_after() bug. Patch by
Chanwook Jung <joey.jung@samsung.com>

From: 정찬욱 [mailto:joey.jung@samsung.com]
Sent: Friday, August 19, 2011 4:40 PM
Subject: [E-devel] [Patch] bug in elm_genlist_item_insert_after

Dear developers.

I found the problem when group item is added using
elm_genlist_item_insert_after in genlist.
The new group item is refer to the group item list not item list.
Therefore
it is inserted in the wrong place.
I modified that if the new group item is inserted, refer to the last
item
of the after group item.
Thanks.

git-svn-id: https://svn.enlightenment.org/svn/e/trunk/elementary@62645 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

Change-Id: Ia95d4a5649875e37ff653f524b7fe22d41b02b70

AUTHORS
src/lib/elm_genlist.c

diff --git a/AUTHORS b/AUTHORS
index cc75c17..fa8e7dc 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -42,3 +42,4 @@ Prince Kumar Dubey <prince.dubey@samsung.com> <prince.dubey@gmail.com>
 Sung W. Park <sungwoo@gmail.com>
 Thierry el Borgi <thierry@substantiel.fr>
 Shilpa Singh <shilpa.singh@samsung.com> <shilpasingh.o@gmail.com>
+Chanwook Jung <joey.jung@samsung.com>
index c10114b..cd0c6dd 100644 (file)
@@ -3667,17 +3667,28 @@ elm_genlist_item_insert_after(Evas_Object                  *obj,
      {
         if ((flags & ELM_GENLIST_ITEM_GROUP) &&
             (after->flags & ELM_GENLIST_ITEM_GROUP))
-          wd->group_items = eina_list_append_relative(wd->group_items, it,
-                                                      after);
+          {
+             Elm_Genlist_Item *it2 = NULL;
+             Eina_List *ll = eina_list_last(after->items);
+             if (ll) it2 = ll->data;
+             else it2 = after;
+
+             wd->items =
+                eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it),
+                                            EINA_INLIST_GET(it2));
+             it->rel = it2;
+             wd->group_items = eina_list_append_relative(wd->group_items, it,
+                                                         after);
+          }
      }
    else
      {
         it->parent->items = eina_list_append_relative(it->parent->items, it,
                                                       after);
+        wd->items = eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it),
+                                                EINA_INLIST_GET(after));
+        it->rel = after;
      }
-   wd->items = eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it),
-                                           EINA_INLIST_GET(after));
-   it->rel = after;
    it->rel->relcount++;
    it->before = EINA_FALSE;
    _item_queue(wd, it);