forked from enlightenment/efl
elementary: use sorted state to improve gengrid and genlist.
SVN revision: 63217
This commit is contained in:
parent
ba60ba6ebe
commit
8cd01e8068
|
@ -59,6 +59,7 @@
|
|||
|
||||
struct _Widget_Data
|
||||
{
|
||||
Eina_Inlist_Sorted_State *state;
|
||||
Evas_Object *self, *scr;
|
||||
Evas_Object *pan_smart;
|
||||
Pan *pan;
|
||||
|
@ -1901,9 +1902,12 @@ elm_gengrid_item_direct_sorted_insert(Evas_Object *obj,
|
|||
item = _item_create(wd, gic, data, func, func_data);
|
||||
if (!item) return NULL;
|
||||
|
||||
if (!wd->state)
|
||||
wd->state = eina_inlist_sorted_state_new();
|
||||
|
||||
_elm_gengrid_item_compare_cb = comp;
|
||||
wd->items = eina_inlist_sorted_insert(wd->items, EINA_INLIST_GET(item),
|
||||
_elm_gengrid_item_compare);
|
||||
wd->items = eina_inlist_sorted_state_insert(wd->items, EINA_INLIST_GET(item),
|
||||
_elm_gengrid_item_compare, wd->state);
|
||||
if (wd->calc_job) ecore_job_del(wd->calc_job);
|
||||
wd->calc_job = ecore_job_add(_calc_job, wd);
|
||||
|
||||
|
@ -1972,6 +1976,11 @@ elm_gengrid_clear(Evas_Object *obj)
|
|||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
|
||||
if (wd->state)
|
||||
{
|
||||
eina_inlist_sorted_state_free(wd->state);
|
||||
wd->state = NULL;
|
||||
}
|
||||
if (wd->calc_job)
|
||||
{
|
||||
ecore_job_del(wd->calc_job);
|
||||
|
|
|
@ -15,6 +15,7 @@ typedef struct _Item_Cache Item_Cache;
|
|||
|
||||
struct _Widget_Data
|
||||
{
|
||||
Eina_Inlist_Sorted_State *state;
|
||||
Evas_Object *obj, *scr, *pan_smart;
|
||||
Eina_Inlist *items, *blocks;
|
||||
Eina_List *group_items;
|
||||
|
@ -3652,11 +3653,16 @@ elm_genlist_item_direct_sorted_insert(Evas_Object *obj,
|
|||
}
|
||||
else
|
||||
{
|
||||
if (!wd->state)
|
||||
{
|
||||
wd->state = eina_inlist_sorted_state_new();
|
||||
}
|
||||
|
||||
if (flags & ELM_GENLIST_ITEM_GROUP)
|
||||
wd->group_items = eina_list_append(wd->group_items, it);
|
||||
|
||||
wd->items = eina_inlist_sorted_insert(wd->items, EINA_INLIST_GET(it),
|
||||
_elm_genlist_item_compare);
|
||||
wd->items = eina_inlist_sorted_state_insert(wd->items, EINA_INLIST_GET(it),
|
||||
_elm_genlist_item_compare, wd->state);
|
||||
|
||||
if (EINA_INLIST_GET(it)->next)
|
||||
{
|
||||
|
@ -3703,6 +3709,11 @@ elm_genlist_clear(Evas_Object *obj)
|
|||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
if (wd->state)
|
||||
{
|
||||
eina_inlist_sorted_state_free(wd->state);
|
||||
wd->state = NULL;
|
||||
}
|
||||
if (wd->walking > 0)
|
||||
{
|
||||
Elm_Genlist_Item *it;
|
||||
|
|
Loading…
Reference in New Issue