forked from enlightenment/efl
From: Daniel Juyung Seo <juyung.seo@samsung.com>
Subject: [E-devel] [Patch] genlist item cache exception handling patch I added "no cached item" handling. In some case, items should not be cached and should not use caches. For example, if there was a state change in item style, it should not be cached because it remembers the state changes. And if we use elm_genlist_item_item_class_update() API, item should not be cached as well. It needs to be a fresh item style without remembering the state changes. SVN revision: 56585
This commit is contained in:
parent
b91af8da1a
commit
cc3d766cfb
|
@ -413,6 +413,7 @@ struct _Elm_Genlist_Item
|
|||
Eina_Bool down : 1;
|
||||
Eina_Bool dragging : 1;
|
||||
Eina_Bool updateme : 1;
|
||||
Eina_Bool nocache : 1;
|
||||
};
|
||||
|
||||
struct _Item_Cache
|
||||
|
@ -1610,12 +1611,15 @@ _item_realize(Elm_Genlist_Item *it,
|
|||
const char *treesize;
|
||||
char buf[1024];
|
||||
int depth, tsize = 20;
|
||||
Item_Cache *itc;
|
||||
Item_Cache *itc = NULL;
|
||||
|
||||
if ((it->realized) || (it->delete_me)) return;
|
||||
it->order_num_in = in;
|
||||
|
||||
itc = _item_cache_find(it);
|
||||
if (it->nocache)
|
||||
it->nocache = EINA_FALSE;
|
||||
else
|
||||
itc = _item_cache_find(it);
|
||||
if (itc)
|
||||
{
|
||||
it->base.view = itc->base_view;
|
||||
|
@ -1859,7 +1863,15 @@ _item_unrealize(Elm_Genlist_Item *it)
|
|||
ecore_timer_del(it->long_timer);
|
||||
it->long_timer = NULL;
|
||||
}
|
||||
_item_cache_add(it);
|
||||
if (it->nocache)
|
||||
{
|
||||
evas_object_del(it->base.view);
|
||||
it->base.view = NULL;
|
||||
evas_object_del(it->spacer);
|
||||
it->spacer = NULL;
|
||||
}
|
||||
else
|
||||
_item_cache_add(it);
|
||||
elm_widget_stringlist_free(it->labels);
|
||||
it->labels = NULL;
|
||||
elm_widget_stringlist_free(it->icons);
|
||||
|
@ -4137,6 +4149,7 @@ elm_genlist_item_item_class_update(Elm_Genlist_Item *it,
|
|||
EINA_SAFETY_ON_NULL_RETURN(itc);
|
||||
if (it->delete_me) return;
|
||||
it->itc = itc;
|
||||
it->nocache = EINA_TRUE;
|
||||
elm_genlist_item_update(it);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue