sanghyeonlee pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=782f28e9a117073421398b65f6f97590c93d2c73

commit 782f28e9a117073421398b65f6f97590c93d2c73
Author: SangHyeon Lee <[email protected]>
Date:   Wed May 11 20:32:55 2016 +0900

    genlist : fix content cache issue by content_get
    
    Summary:
    genlist content_get sometimes work weird after reusable_content_get pushed.
    cached content is shown even content_get function is not exist or
    return NULL.
    now cache check item_class instead of item style string.
    
    Test Plan: check genlist cache in elementary_test
    
    Reviewers: Hermet, cedric, raster
    
    Subscribers: Jaehyun_Cho, jpeg
    
    Differential Revision: https://phab.enlightenment.org/D3921
    
    Conflicts:
        src/lib/elementary/elm_genlist.c
---
 src/lib/elementary/elm_genlist.c        | 10 +++++-----
 src/lib/elementary/elm_widget_genlist.h |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c
index 1abfe0c..45bb5b3 100644
--- a/src/lib/elementary/elm_genlist.c
+++ b/src/lib/elementary/elm_genlist.c
@@ -1508,7 +1508,7 @@ _item_cache_free(Item_Cache *itc)
 
    evas_object_del(itc->spacer);
    evas_object_del(itc->base_view);
-   eina_stringshare_del(itc->item_style);
+   itc->item_class = NULL;
    EINA_LIST_FREE(itc->contents, c)
      {
         evas_object_del(c);
@@ -1568,7 +1568,7 @@ _item_cache_add(Elm_Gen_Item *it, Eina_List *contents)
      }
    itc->spacer = it->spacer;
    itc->base_view = VIEW(it);
-   itc->item_style = eina_stringshare_add(it->itc->item_style);
+   itc->item_class = it->itc;
    itc->contents = contents;
    if (it->item->type & ELM_GENLIST_ITEM_TREE)
      {
@@ -1632,9 +1632,9 @@ _item_cache_find(Elm_Gen_Item *it)
    EINA_INLIST_FOREACH_SAFE(sd->item_cache, l, itc)
      {
         if ((itc->tree == tree) &&
-            (((!it->itc->item_style) && (!itc->item_style)) ||
-             (it->itc->item_style && itc->item_style &&
-              (!strcmp(it->itc->item_style, itc->item_style)))))
+            (((!it->itc) && (!itc->item_class)) ||
+             (it->itc && itc->item_class &&
+              (it->itc == itc->item_class))))
           {
              itc = _item_cache_pop(sd, itc);
              if (!itc) continue;
diff --git a/src/lib/elementary/elm_widget_genlist.h 
b/src/lib/elementary/elm_widget_genlist.h
index bf06755..393f2a9 100644
--- a/src/lib/elementary/elm_widget_genlist.h
+++ b/src/lib/elementary/elm_widget_genlist.h
@@ -276,7 +276,7 @@ struct _Item_Cache
    EINA_INLIST;
 
    Evas_Object *base_view, *spacer;
-   const char  *item_style; // it->itc->item_style
+   const Elm_Genlist_Item_Class  *item_class; // it->itc
    Eina_Bool    tree : 1; // it->group
    Eina_List   *contents; // content objects for reusing
 };

-- 


Reply via email to