summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2015-01-15 20:26:04 +0900
committerChunEon Park <hermet@hermet.pe.kr>2015-01-15 20:26:04 +0900
commit94f0f1ba40d6066d4bf8b7594c2c636b49966b16 (patch)
tree406c89b5eb0f01debe77eceb920e115045346999
parentc4703dea54eb886ab26061055d5183d13e6a8a12 (diff)
Revert "genilst: get rid of lazy deletion."
This reverts commit 0e7d521151ba93f3b5955caaf9b906e160ab6057. Conflicts: src/lib/elm_genlist.c src/lib/elm_widget.h
-rw-r--r--src/lib/elm_genlist.c89
-rw-r--r--src/lib/elm_widget_genlist.h6
2 files changed, 79 insertions, 16 deletions
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index 1168f3ec0..785316420 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -1287,7 +1287,9 @@ _decorate_all_item_realize(Elm_Gen_Item *it,
1287 if (!it) return; 1287 if (!it) return;
1288 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); 1288 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
1289 1289
1290 if (it->item->decorate_all_item_realized) return; 1290 if ((it->item->decorate_all_item_realized) ||
1291 (it->generation < sd->generation))
1292 return;
1291 1293
1292 it->deco_all_view = edje_object_add(evas_object_evas_get(WIDGET(it))); 1294 it->deco_all_view = edje_object_add(evas_object_evas_get(WIDGET(it)));
1293 edje_object_scale_set(it->deco_all_view, elm_widget_scale_get(WIDGET(it)) * 1295 edje_object_scale_set(it->deco_all_view, elm_widget_scale_get(WIDGET(it)) *
@@ -1622,6 +1624,7 @@ _item_realize(Elm_Gen_Item *it,
1622 int tsize = 20; 1624 int tsize = 20;
1623 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); 1625 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
1624 1626
1627 if (it->generation < sd->generation) return;
1625 if (it->realized) 1628 if (it->realized)
1626 { 1629 {
1627 if (it->item->order_num_in != in) 1630 if (it->item->order_num_in != in)
@@ -2155,7 +2158,9 @@ _item_block_position(Item_Block *itb,
2155 EINA_LIST_FOREACH(itb->items, l, it) 2158 EINA_LIST_FOREACH(itb->items, l, it)
2156 { 2159 {
2157 sd = GL_IT(it)->wsd; 2160 sd = GL_IT(it)->wsd;
2158 if (sd->reorder_it == it) continue; 2161 if (it->generation < sd->generation) continue;
2162 else if (sd->reorder_it == it)
2163 continue;
2159 2164
2160 it->x = 0; 2165 it->x = 0;
2161 it->y = y; 2166 it->y = y;
@@ -2382,7 +2387,9 @@ _item_multi_select_up(Elm_Genlist_Data *sd)
2382 while (eo_prev) 2387 while (eo_prev)
2383 { 2388 {
2384 ELM_GENLIST_ITEM_DATA_GET(eo_prev, prev); 2389 ELM_GENLIST_ITEM_DATA_GET(eo_prev, prev);
2385 if ((!_is_no_select(prev)) && (!elm_object_item_disabled_get(eo_prev))) 2390 if ((prev->generation == sd->generation) &&
2391 (!_is_no_select(prev)) &&
2392 (!elm_object_item_disabled_get(eo_prev)))
2386 break; 2393 break;
2387 eo_prev = EO_OBJ(ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(prev)->prev)); 2394 eo_prev = EO_OBJ(ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(prev)->prev));
2388 } 2395 }
@@ -2414,7 +2421,9 @@ _item_multi_select_down(Elm_Genlist_Data *sd)
2414 while ((eo_next)) 2421 while ((eo_next))
2415 { 2422 {
2416 ELM_GENLIST_ITEM_DATA_GET(eo_next, next); 2423 ELM_GENLIST_ITEM_DATA_GET(eo_next, next);
2417 if ((_is_no_select(next)) && (!elm_object_item_disabled_get(eo_next))) 2424 if ((next->generation == sd->generation) &&
2425 (!_is_no_select(next)) &&
2426 (!elm_object_item_disabled_get(eo_next)))
2418 break; 2427 break;
2419 eo_next = EO_OBJ(ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(next)->next)); 2428 eo_next = EO_OBJ(ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(next)->next));
2420 } 2429 }
@@ -2468,7 +2477,8 @@ _item_single_select_up(Elm_Genlist_Data *sd)
2468 2477
2469 while (prev) 2478 while (prev)
2470 { 2479 {
2471 if ((!_is_no_select(prev)) && 2480 if ((prev->generation == sd->generation) &&
2481 (!_is_no_select(prev)) &&
2472 (!elm_object_item_disabled_get(EO_OBJ(prev)))) 2482 (!elm_object_item_disabled_get(EO_OBJ(prev))))
2473 break; 2483 break;
2474 prev = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(prev)->prev); 2484 prev = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(prev)->prev);
@@ -2499,7 +2509,8 @@ _item_single_select_down(Elm_Genlist_Data *sd)
2499 2509
2500 while ((next)) 2510 while ((next))
2501 { 2511 {
2502 if ((!_is_no_select(next)) && 2512 if ((next->generation == sd->generation) &&
2513 (!_is_no_select(next)) &&
2503 (!elm_object_item_disabled_get(EO_OBJ(next)))) 2514 (!elm_object_item_disabled_get(EO_OBJ(next))))
2504 break; 2515 break;
2505 next = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(next)->next); 2516 next = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(next)->next);
@@ -2523,6 +2534,9 @@ _elm_genlist_item_focused(Elm_Object_Item *eo_it)
2523 ELM_GENLIST_DATA_GET(obj, sd); 2534 ELM_GENLIST_DATA_GET(obj, sd);
2524 const char *focus_raise; 2535 const char *focus_raise;
2525 2536
2537 if (it->generation < sd->generation)
2538 return;
2539
2526 if (_is_no_select(it) || 2540 if (_is_no_select(it) ||
2527 (eo_it == sd->focused_item) || 2541 (eo_it == sd->focused_item) ||
2528 (eo_do(eo_it, elm_wdg_item_disabled_get()))) 2542 (eo_do(eo_it, elm_wdg_item_disabled_get())))
@@ -2562,6 +2576,9 @@ _elm_genlist_item_unfocused(Elm_Object_Item *eo_it)
2562 Evas_Object *obj = WIDGET(it); 2576 Evas_Object *obj = WIDGET(it);
2563 ELM_GENLIST_DATA_GET(obj, sd); 2577 ELM_GENLIST_DATA_GET(obj, sd);
2564 2578
2579 if (it->generation < sd->generation)
2580 return;
2581
2565 if (_is_no_select(it)) 2582 if (_is_no_select(it))
2566 return; 2583 return;
2567 2584
@@ -2598,6 +2615,7 @@ _item_focused_next(Evas_Object *obj, Elm_Focus_Direction dir)
2598 return EINA_FALSE; 2615 return EINA_FALSE;
2599 2616
2600 while ((next) && 2617 while ((next) &&
2618 (next->generation < sd->generation) &&
2601 (!eo_do(EO_OBJ(next), elm_wdg_item_disabled_get()))) 2619 (!eo_do(EO_OBJ(next), elm_wdg_item_disabled_get())))
2602 next = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(next)->next); 2620 next = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(next)->next);
2603 } 2621 }
@@ -3330,6 +3348,7 @@ _item_highlight(Elm_Gen_Item *it)
3330 3348
3331 if (_is_no_select(it) || 3349 if (_is_no_select(it) ||
3332 (!sd->highlight) || 3350 (!sd->highlight) ||
3351 (it->generation < sd->generation) ||
3333 (it->highlighted) || eo_do(EO_OBJ(it), elm_wdg_item_disabled_get()) || 3352 (it->highlighted) || eo_do(EO_OBJ(it), elm_wdg_item_disabled_get()) ||
3334 (it->item->deco_it_view)) 3353 (it->item->deco_it_view))
3335 return; 3354 return;
@@ -3355,7 +3374,8 @@ _item_unhighlight(Elm_Gen_Item *it)
3355{ 3374{
3356 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); 3375 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
3357 3376
3358 if (!it->highlighted) return; 3377 if ((it->generation < GL_IT(it)->wsd->generation) || (!it->highlighted))
3378 return;
3359 3379
3360 edje_object_signal_emit(VIEW(it), SIGNAL_UNSELECTED, "elm"); 3380 edje_object_signal_emit(VIEW(it), SIGNAL_UNSELECTED, "elm");
3361 evas_object_smart_callback_call(WIDGET(it), SIG_UNHIGHLIGHTED, EO_OBJ(it)); 3381 evas_object_smart_callback_call(WIDGET(it), SIG_UNHIGHLIGHTED, EO_OBJ(it));
@@ -3542,6 +3562,7 @@ _elm_genlist_item_del_not_serious(Elm_Gen_Item *it)
3542 Elm_Object_Item *eo_it = EO_OBJ(it); 3562 Elm_Object_Item *eo_it = EO_OBJ(it);
3543 3563
3544 eo_do(eo_it, elm_wdg_item_pre_notify_del()); 3564 eo_do(eo_it, elm_wdg_item_pre_notify_del());
3565 it->generation = sd->generation - 1; // This means that the item is deleted
3545 3566
3546 if (it->selected) 3567 if (it->selected)
3547 { 3568 {
@@ -3642,7 +3663,8 @@ _item_unselect(Elm_Gen_Item *it)
3642{ 3663{
3643 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); 3664 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
3644 3665
3645 _item_unhighlight(it); /* unhighlight the item first */ 3666 if ((it->generation < sd->generation)) return;
3667 _item_unhighlight(it); /* unhighlight the item first */
3646 if (!it->selected) return; /* then check whether the item is selected */ 3668 if (!it->selected) return; /* then check whether the item is selected */
3647 3669
3648 if (GL_IT(it)->wsd->focus_on_selection_enabled) 3670 if (GL_IT(it)->wsd->focus_on_selection_enabled)
@@ -4920,7 +4942,8 @@ _decorate_item_finished_signal_cb(void *data,
4920 4942
4921 te = evas_object_evas_get(obj); 4943 te = evas_object_evas_get(obj);
4922 4944
4923 if ((!it->realized) || (!it->item->deco_it_view)) return; 4945 if ((it->generation < sd->generation) || (!it->realized)
4946 || (!it->item->deco_it_view)) return;
4924 4947
4925 evas_event_freeze(te); 4948 evas_event_freeze(te);
4926 it->item->nocache_once = EINA_FALSE; 4949 it->item->nocache_once = EINA_FALSE;
@@ -4987,6 +5010,7 @@ _item_block_recalc(Item_Block *itb,
4987 EINA_LIST_FOREACH(itb->items, l, it) 5010 EINA_LIST_FOREACH(itb->items, l, it)
4988 { 5011 {
4989 sd = GL_IT(it)->wsd; 5012 sd = GL_IT(it)->wsd;
5013 if (it->generation < sd->generation) continue;
4990 show_me |= it->item->show_me; 5014 show_me |= it->item->show_me;
4991 if (!itb->realized) 5015 if (!itb->realized)
4992 { 5016 {
@@ -5266,7 +5290,8 @@ _decorate_item_realize(Elm_Gen_Item *it)
5266 Evas_Object *obj = sd->obj; 5290 Evas_Object *obj = sd->obj;
5267 char buf[1024]; 5291 char buf[1024];
5268 5292
5269 if (GL_IT(it)->deco_it_view) return; 5293 if (it->generation < sd->generation) return;
5294 if (it->item->deco_it_view) return;
5270 5295
5271 evas_event_freeze(evas_object_evas_get(obj)); 5296 evas_event_freeze(evas_object_evas_get(obj));
5272 it->item->deco_it_view = _view_create(it, it->itc->decorate_item_style); 5297 it->item->deco_it_view = _view_create(it, it->itc->decorate_item_style);
@@ -5435,6 +5460,8 @@ _elm_genlist_evas_object_smart_add(Eo *obj, Elm_Genlist_Data *priv)
5435 elm_widget_can_focus_set(obj, EINA_TRUE); 5460 elm_widget_can_focus_set(obj, EINA_TRUE);
5436 elm_widget_on_show_region_hook_set(obj, _show_region_hook, NULL); 5461 elm_widget_on_show_region_hook_set(obj, _show_region_hook, NULL);
5437 5462
5463 priv->generation = 1;
5464
5438 if (!elm_layout_theme_set 5465 if (!elm_layout_theme_set
5439 (obj, "genlist", "base", elm_widget_style_get(obj))) 5466 (obj, "genlist", "base", elm_widget_style_get(obj)))
5440 CRI("Failed to set layout!"); 5467 CRI("Failed to set layout!");
@@ -5600,6 +5627,9 @@ _internal_elm_genlist_clear(Evas_Object *obj)
5600{ 5627{
5601 ELM_GENLIST_DATA_GET(obj, sd); 5628 ELM_GENLIST_DATA_GET(obj, sd);
5602 Elm_Gen_Item *it; 5629 Elm_Gen_Item *it;
5630 Eina_Inlist *l, *next;
5631
5632 sd->generation++;
5603 5633
5604 _elm_genlist_item_unfocused(sd->focused_item); 5634 _elm_genlist_item_unfocused(sd->focused_item);
5605 if (sd->mode_item) sd->mode_item = NULL; 5635 if (sd->mode_item) sd->mode_item = NULL;
@@ -5613,7 +5643,8 @@ _internal_elm_genlist_clear(Evas_Object *obj)
5613 while (sd->items) 5643 while (sd->items)
5614 { 5644 {
5615 it = EINA_INLIST_CONTAINER_GET(sd->items->last, Elm_Gen_Item); 5645 it = EINA_INLIST_CONTAINER_GET(sd->items->last, Elm_Gen_Item);
5616 eo_do(EO_OBJ(it), elm_wdg_item_del()); 5646 if (it->generation < sd->generation)
5647 eo_do(EO_OBJ(it), elm_wdg_item_del());
5617 } 5648 }
5618 sd->pan_changed = EINA_TRUE; 5649 sd->pan_changed = EINA_TRUE;
5619 if (!sd->queue) 5650 if (!sd->queue)
@@ -5659,6 +5690,7 @@ _item_select(Elm_Gen_Item *it)
5659 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); 5690 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
5660 Elm_Object_Item *eo_it = EO_OBJ(it); 5691 Elm_Object_Item *eo_it = EO_OBJ(it);
5661 5692
5693 if (it->generation < sd->generation) return EINA_FALSE;
5662 if (eo_do(eo_it, elm_wdg_item_disabled_get())) return EINA_FALSE; 5694 if (eo_do(eo_it, elm_wdg_item_disabled_get())) return EINA_FALSE;
5663 if (_is_no_select(it) || (it->decorate_it_set)) return EINA_FALSE; 5695 if (_is_no_select(it) || (it->decorate_it_set)) return EINA_FALSE;
5664 if ((sd->select_mode != ELM_OBJECT_SELECT_MODE_ALWAYS) && 5696 if ((sd->select_mode != ELM_OBJECT_SELECT_MODE_ALWAYS) &&
@@ -5766,6 +5798,8 @@ _elm_genlist_item_elm_widget_item_disable(Eo *eo_it, Elm_Gen_Item *it)
5766 Eina_List *l; 5798 Eina_List *l;
5767 Evas_Object *obj; 5799 Evas_Object *obj;
5768 5800
5801 if (it->generation < GL_IT(it)->wsd->generation) return;
5802
5769 _item_unselect(it); 5803 _item_unselect(it);
5770 if (eo_it == GL_IT(it)->wsd->focused_item) 5804 if (eo_it == GL_IT(it)->wsd->focused_item)
5771 _elm_genlist_item_unfocused(eo_it); 5805 _elm_genlist_item_unfocused(eo_it);
@@ -5878,6 +5912,7 @@ _elm_genlist_item_new(Elm_Genlist_Data *sd,
5878 if (!eo_it) return NULL; 5912 if (!eo_it) return NULL;
5879 ELM_GENLIST_ITEM_DATA_GET(eo_it, it); 5913 ELM_GENLIST_ITEM_DATA_GET(eo_it, it);
5880 5914
5915 it->generation = sd->generation;
5881 it->itc = itc; 5916 it->itc = itc;
5882 elm_genlist_item_class_ref((Elm_Genlist_Item_Class *)itc); 5917 elm_genlist_item_class_ref((Elm_Genlist_Item_Class *)itc);
5883 5918
@@ -6399,7 +6434,15 @@ _elm_genlist_at_xy_item_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, Evas_Coor
6399EOLIAN static Elm_Object_Item* 6434EOLIAN static Elm_Object_Item*
6400_elm_genlist_first_item_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd) 6435_elm_genlist_first_item_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
6401{ 6436{
6402 return EO_OBJ(ELM_GEN_ITEM_FROM_INLIST(sd->items)); 6437 Elm_Gen_Item *it;
6438
6439 if (!sd->items) return NULL;
6440
6441 it = ELM_GEN_ITEM_FROM_INLIST(sd->items);
6442 while ((it) && (it->generation < sd->generation))
6443 it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
6444
6445 return EO_OBJ(it);
6403} 6446}
6404 6447
6405EOLIAN static Elm_Object_Item* 6448EOLIAN static Elm_Object_Item*
@@ -6410,6 +6453,8 @@ _elm_genlist_last_item_get(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd)
6410 if (!sd->items) return NULL; 6453 if (!sd->items) return NULL;
6411 6454
6412 it = ELM_GEN_ITEM_FROM_INLIST(sd->items->last); 6455 it = ELM_GEN_ITEM_FROM_INLIST(sd->items->last);
6456 while ((it) && (it->generation < sd->generation))
6457 it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
6413 6458
6414 return EO_OBJ(it); 6459 return EO_OBJ(it);
6415} 6460}
@@ -6420,7 +6465,7 @@ _elm_genlist_item_next_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
6420 while (it) 6465 while (it)
6421 { 6466 {
6422 it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next); 6467 it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
6423 if (it) break; 6468 if ((it) && (it->generation == GL_IT(it)->wsd->generation)) break;
6424 } 6469 }
6425 6470
6426 if (it) return EO_OBJ(it); 6471 if (it) return EO_OBJ(it);
@@ -6433,7 +6478,7 @@ _elm_genlist_item_prev_get(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
6433 while (it) 6478 while (it)
6434 { 6479 {
6435 it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev); 6480 it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
6436 if (it) break; 6481 if ((it) && (it->generation == GL_IT(it)->wsd->generation)) break;
6437 } 6482 }
6438 6483
6439 if (it) return EO_OBJ(it); 6484 if (it) return EO_OBJ(it);
@@ -6494,8 +6539,10 @@ _elm_genlist_item_selected_set(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it,
6494 Eina_Bool selected) 6539 Eina_Bool selected)
6495{ 6540{
6496 ELM_GENLIST_ITEM_CHECK_OR_RETURN(it); 6541 ELM_GENLIST_ITEM_CHECK_OR_RETURN(it);
6542 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
6497 6543
6498 if (eo_do(EO_OBJ(it), elm_wdg_item_disabled_get())) return; 6544 if ((it->generation < sd->generation) ||
6545 eo_do(EO_OBJ(it), elm_wdg_item_disabled_get())) return;
6499 6546
6500 selected = !!selected; 6547 selected = !!selected;
6501 if (it->selected == selected) return; 6548 if (it->selected == selected) return;
@@ -6663,6 +6710,7 @@ _elm_genlist_item_coordinates_calc(Elm_Gen_Item *it,
6663 Evas_Coord gith = 0; 6710 Evas_Coord gith = 0;
6664 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); 6711 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
6665 6712
6713 if (it->generation < sd->generation) return EINA_FALSE;
6666 if ((sd->queue) || 6714 if ((sd->queue) ||
6667 (!((sd->homogeneous) && 6715 (!((sd->homogeneous) &&
6668 (sd->mode == ELM_LIST_COMPRESS)))) 6716 (sd->mode == ELM_LIST_COMPRESS))))
@@ -6717,6 +6765,7 @@ _elm_genlist_item_promote(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
6717{ 6765{
6718 ELM_GENLIST_ITEM_CHECK_OR_RETURN(it); 6766 ELM_GENLIST_ITEM_CHECK_OR_RETURN(it);
6719 6767
6768 if (it->generation < GL_IT(it)->wsd->generation) return;
6720 Elm_Object_Item *eo_first_item = elm_genlist_first_item_get(WIDGET(it)); 6769 Elm_Object_Item *eo_first_item = elm_genlist_first_item_get(WIDGET(it));
6721 ELM_GENLIST_ITEM_DATA_GET(eo_first_item, first_item); 6770 ELM_GENLIST_ITEM_DATA_GET(eo_first_item, first_item);
6722 _item_move_before(it, first_item); 6771 _item_move_before(it, first_item);
@@ -6726,6 +6775,7 @@ EOLIAN static void
6726_elm_genlist_item_demote(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it) 6775_elm_genlist_item_demote(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
6727{ 6776{
6728 ELM_GENLIST_ITEM_CHECK_OR_RETURN(it); 6777 ELM_GENLIST_ITEM_CHECK_OR_RETURN(it);
6778 if (it->generation < GL_IT(it)->wsd->generation) return;
6729 Elm_Object_Item *eo_last_item = elm_genlist_last_item_get(WIDGET(it)); 6779 Elm_Object_Item *eo_last_item = elm_genlist_last_item_get(WIDGET(it));
6730 ELM_GENLIST_ITEM_DATA_GET(eo_last_item, last_item); 6780 ELM_GENLIST_ITEM_DATA_GET(eo_last_item, last_item);
6731 _item_move_after(it, last_item); 6781 _item_move_after(it, last_item);
@@ -6779,6 +6829,7 @@ _elm_genlist_item_update(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it)
6779 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); 6829 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
6780 6830
6781 if (!it->item->block) return; 6831 if (!it->item->block) return;
6832 if (it->generation < sd->generation) return;
6782 it->item->mincalcd = EINA_FALSE; 6833 it->item->mincalcd = EINA_FALSE;
6783 it->item->updateme = EINA_TRUE; 6834 it->item->updateme = EINA_TRUE;
6784 it->item->block->updateme = EINA_TRUE; 6835 it->item->block->updateme = EINA_TRUE;
@@ -6794,6 +6845,7 @@ _elm_genlist_item_fields_update(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it,
6794 ELM_GENLIST_ITEM_CHECK_OR_RETURN(it); 6845 ELM_GENLIST_ITEM_CHECK_OR_RETURN(it);
6795 6846
6796 if (!it->item->block) return; 6847 if (!it->item->block) return;
6848 if (it->generation < GL_IT(it)->wsd->generation) return;
6797 6849
6798 if ((!itf) || (itf & ELM_GENLIST_ITEM_FIELD_TEXT)) 6850 if ((!itf) || (itf & ELM_GENLIST_ITEM_FIELD_TEXT))
6799 { 6851 {
@@ -6848,6 +6900,7 @@ _elm_genlist_item_item_class_update(Eo *eo_it, Elm_Gen_Item *it,
6848 EINA_SAFETY_ON_NULL_RETURN(itc); 6900 EINA_SAFETY_ON_NULL_RETURN(itc);
6849 it->itc = itc; 6901 it->itc = itc;
6850 if (!it->item->block) return; 6902 if (!it->item->block) return;
6903 if (it->generation < GL_IT(it)->wsd->generation) return;
6851 it->item->nocache_once = EINA_TRUE; 6904 it->item->nocache_once = EINA_TRUE;
6852 6905
6853 ELM_SAFE_FREE(it->texts, elm_widget_stringlist_free); 6906 ELM_SAFE_FREE(it->texts, elm_widget_stringlist_free);
@@ -6861,6 +6914,7 @@ EOLIAN static const Elm_Genlist_Item_Class *
6861_elm_genlist_item_item_class_get(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it) 6914_elm_genlist_item_item_class_get(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it)
6862{ 6915{
6863 ELM_GENLIST_ITEM_CHECK_OR_RETURN(it, NULL); 6916 ELM_GENLIST_ITEM_CHECK_OR_RETURN(it, NULL);
6917 if (it->generation < GL_IT(it)->wsd->generation) return NULL;
6864 6918
6865 return it->itc; 6919 return it->itc;
6866} 6920}
@@ -7263,7 +7317,8 @@ _elm_genlist_item_decorate_mode_set(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it,
7263 sd = GL_IT(it)->wsd; 7317 sd = GL_IT(it)->wsd;
7264 7318
7265 if (!decorate_it_type) return; 7319 if (!decorate_it_type) return;
7266 if (eo_do(eo_it, elm_wdg_item_disabled_get())) return; 7320 if ((it->generation < sd->generation) ||
7321 eo_do(eo_it, elm_wdg_item_disabled_get())) return;
7267 if (sd->decorate_all_mode) return; 7322 if (sd->decorate_all_mode) return;
7268 7323
7269 if ((sd->mode_item == it) && 7324 if ((sd->mode_item == it) &&
@@ -7581,6 +7636,8 @@ _elm_genlist_item_select_mode_set(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it,
7581 ELM_GENLIST_ITEM_CHECK_OR_RETURN(it); 7636 ELM_GENLIST_ITEM_CHECK_OR_RETURN(it);
7582 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); 7637 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
7583 7638
7639 if (it->generation < sd->generation) return;
7640
7584 if ((mode >= ELM_OBJECT_SELECT_MODE_MAX) || (it->select_mode == mode)) 7641 if ((mode >= ELM_OBJECT_SELECT_MODE_MAX) || (it->select_mode == mode))
7585 return; 7642 return;
7586 7643
diff --git a/src/lib/elm_widget_genlist.h b/src/lib/elm_widget_genlist.h
index d16c3940e..9df282249 100644
--- a/src/lib/elm_widget_genlist.h
+++ b/src/lib/elm_widget_genlist.h
@@ -123,6 +123,9 @@ struct _Elm_Genlist_Data
123 * default. this can be changed by 123 * default. this can be changed by
124 * elm_genlist_longpress_timeout_set() */ 124 * elm_genlist_longpress_timeout_set() */
125 double longpress_timeout; 125 double longpress_timeout;
126 /* a generation of genlist. when genlist is cleared, this value
127 * will be increased and a new generation will start */
128 int generation;
126 Eina_Compare_Cb item_compare_cb; 129 Eina_Compare_Cb item_compare_cb;
127 Eina_Compare_Cb item_compare_data_cb; 130 Eina_Compare_Cb item_compare_data_cb;
128 131
@@ -174,6 +177,9 @@ struct _Elm_Genlist_Data
174 Eina_Bool on_sub_del : 1; 177 Eina_Bool on_sub_del : 1;
175 178
176 Eina_Bool highlight : 1; 179 Eina_Bool highlight : 1;
180 /* a flag whether genlist is marked as to be cleared or not. if
181 * this flag is true, genlist clear was already deferred. */
182 Eina_Bool clear_me : 1;
177 Eina_Bool h_bounce : 1; 183 Eina_Bool h_bounce : 1;
178 Eina_Bool v_bounce : 1; 184 Eina_Bool v_bounce : 1;
179 Eina_Bool bring_in : 1; /* a flag to 185 Eina_Bool bring_in : 1; /* a flag to