summaryrefslogtreecommitdiff
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-02-21 22:04:10 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-02-22 17:05:08 +0900
commitaa5414f95d37e285b4af5a5f080daf8f900b9e99 (patch)
tree849cdfdde0679fb98d27365b0041d05b9b406cae /src/lib/elementary
parentfe6bdf30cdf3e21cc3c17ea7546eca3cc5e2c6cb (diff)
genlist: Fix insert after with a tree
This fixes a case where inserting item "C" after item "B" in this tree would go wrong: A B - 1 - 2 Before this patch, 1 and 2 lose their parent: A B C - 1 - 2 After this patch, 1 and 2 retain their parent: A B - 1 - 2 C Insert before worked by luck, no need to fix it. Note that this patch may require the next one to actually work (ensuring expanded state flag). NOTE: This is a behaviour break!
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/elm_genlist.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c
index a04edbbd80..e624afe96f 100644
--- a/src/lib/elementary/elm_genlist.c
+++ b/src/lib/elementary/elm_genlist.c
@@ -6356,6 +6356,12 @@ _elm_genlist_item_insert_after(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, const
6356 it->parent->item->items = 6356 it->parent->item->items =
6357 eina_list_append_relative(it->parent->item->items, EO_OBJ(it), eo_after); 6357 eina_list_append_relative(it->parent->item->items, EO_OBJ(it), eo_after);
6358 } 6358 }
6359
6360 if (after->item->items && after->item->expanded)
6361 {
6362 eo_after = eina_list_last_data_get(after->item->items);
6363 after = efl_data_scope_get(eo_after, ELM_GENLIST_ITEM_CLASS);
6364 }
6359 sd->items = eina_inlist_append_relative 6365 sd->items = eina_inlist_append_relative
6360 (sd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(after)); 6366 (sd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(after));
6361 6367