ami pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=c2fce0d10b143f7805c4df2eba7f2034863ca7fd

commit c2fce0d10b143f7805c4df2eba7f2034863ca7fd
Author: Amitesh Singh <amitesh...@samsung.com>
Date:   Thu Feb 4 23:44:19 2016 +0530

    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
---
 src/lib/elm_genlist.c | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index 914bb1c..03d6c9a 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

-- 


Reply via email to