genlist: skip unnecessary process call while genlist clearing 82/212782/3
authorSangHyeon Jade Lee <sh10233.lee@samsung.com>
Tue, 27 Aug 2019 01:21:36 +0000 (10:21 +0900)
committerSangHyeon Lee <sh10233.lee@samsung.com>
Mon, 23 Sep 2019 08:11:14 +0000 (08:11 +0000)
item_process is calling while genlist clearing when
the item is relatvely added.

skiping unnecessary process calls improve deletion performances.

Change-Id: Ic12c4ea190799a79fb2f369569b453d5061f8019
Signed-off-by: SangHyeon Jade Lee <sh10233.lee@samsung.com>
src/lib/elementary_tizen/elm_genlist.c
src/lib/elementary_tizen/elm_widget_genlist.h

index 4964362..62635f8 100644 (file)
@@ -6860,6 +6860,8 @@ _internal_elm_genlist_clear(Evas_Object *obj)
    ELM_GENLIST_DATA_GET(obj, sd);
    Elm_Gen_Item *it;
 
+   sd->on_clear = EINA_TRUE;
+
    eina_hash_free_buckets(sd->size_caches);
    elm_object_item_focus_set(sd->focused_item, EINA_FALSE);
    if (sd->key_down_item) sd->key_down_item = NULL;
@@ -6962,6 +6964,8 @@ _internal_elm_genlist_clear(Evas_Object *obj)
              ELM_SAFE_FREE(sd->banded_bg_rect, evas_object_del);
           }
      }
+
+   sd->on_clear = EINA_FALSE;
 }
 
 EOLIAN static Evas_Object *
@@ -7058,7 +7062,7 @@ _item_free(Elm_Gen_Item *it)
         Elm_Gen_Item *tmp;
         EINA_LIST_FREE(GL_IT(it)->rel_revs, tmp)
           {
-             if (tmp->item->queued && !(tmp->base)->on_deletion)
+             if (tmp->item->queued && !((tmp->base)->on_deletion || sd->on_clear))
                {
                   GL_IT(tmp)->queued = EINA_FALSE;
                   GL_IT(tmp)->resized = EINA_FALSE;
index 682adb1..bfc48b7 100644 (file)
@@ -305,6 +305,7 @@ struct _Elm_Genlist_Data
    Eina_Bool                             unhighlight_skip: 1;
    Eina_Bool                             bottom_margin_enabled : 1;
    Eina_Bool                             unhighlighted : 1;
+   Eina_Bool                             on_clear : 1;
 };
 
 typedef struct _Item_Block Item_Block;