diff options
author | Amitesh Singh <amitesh.sh@samsung.com> | 2016-02-04 23:44:19 +0530 |
---|---|---|
committer | Amitesh Singh <amitesh.sh@samsung.com> | 2016-02-04 23:47:01 +0530 |
commit | c2fce0d10b143f7805c4df2eba7f2034863ca7fd (patch) | |
tree | 523482c5e6d41881489b071c8e5189fbc2c3f2a6 | |
parent | 13e2ed7cd8f3499ed1b0e68a877243f044becb7f (diff) | |
download | elementary-c2fce0d10b143f7805c4df2eba7f2034863ca7fd.tar.gz |
genlist: update all realized items in a single job
Summary:
Its really weird to call same job for each item and deletes that job in
next iteration. Since item_update() deletes the old update_job ecore job
again so basically we call update job only for the last realized item in the list.
@fix
Reviewers: raster, jpeg, cedric, SanghyeonLee, tasn
Reviewed By: SanghyeonLee
Subscribers: seoz
Projects: #elementary
Differential Revision: https://phab.enlightenment.org/D3644
-rw-r--r-- | src/lib/elm_genlist.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c index 914bb1ca0..03d6c9a31 100644 --- a/src/lib/elm_genlist.c +++ b/src/lib/elm_genlist.c @@ -6972,6 +6972,14 @@ _elm_genlist_item_all_contents_unset(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it, } } +static void +_mark_item_update(Elm_Gen_Item *it) +{ + it->item->mincalcd = EINA_FALSE; + it->item->updateme = EINA_TRUE; + it->item->block->updateme = EINA_TRUE; +} + EOLIAN static void _elm_genlist_item_update(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it) { @@ -6979,9 +6987,7 @@ _elm_genlist_item_update(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it) ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); if (!it->item->block) return; - it->item->mincalcd = EINA_FALSE; - it->item->updateme = EINA_TRUE; - it->item->block->updateme = EINA_TRUE; + _mark_item_update(it); ecore_job_del(sd->update_job); sd->update_job = ecore_job_add(_update_job, sd->obj); } @@ -7695,14 +7701,20 @@ _elm_genlist_elm_interface_scrollable_policy_get(Eo *obj, Elm_Genlist_Data *sd E } EOLIAN static void -_elm_genlist_realized_items_update(Eo *obj, Elm_Genlist_Data *_pd EINA_UNUSED) +_elm_genlist_realized_items_update(Eo *obj, Elm_Genlist_Data *_pd) { Eina_List *list; Elm_Object_Item *it; list = elm_genlist_realized_items_get(obj); EINA_LIST_FREE(list, it) - elm_genlist_item_update(it); + { + ELM_GENLIST_ITEM_DATA_GET(it, it2); + if (!it2->item->block) continue; + _mark_item_update(it2); + } + ecore_job_del(_pd->update_job); + _pd->update_job = ecore_job_add(_update_job, obj); } EOLIAN static void |