diff --git a/legacy/elementary/src/lib/elm_deprecated.h b/legacy/elementary/src/lib/elm_deprecated.h index 1f4c88c860..3932e54058 100644 --- a/legacy/elementary/src/lib/elm_deprecated.h +++ b/legacy/elementary/src/lib/elm_deprecated.h @@ -1720,6 +1720,20 @@ EINA_DEPRECATED EAPI const Evas_Object *elm_genlist_item_object_get(c */ EINA_DEPRECATED EAPI Elm_Genlist_Item_Type elm_genlist_item_flags_get(const Elm_Object_Item *it); +/** + * Tells genlist to "orphan" contents fetched by the item class + * + * @param it The item + * + * This instructs genlist to release references to contents in the item, + * meaning that they will no longer be managed by genlist and are + * floating "orphans" that can be re-used elsewhere if the user wants + * to. + * + * @deprecated Use elm_genlist_item_all_contents_unset() instead + * @ingroup Genlist + */ +EAPI void elm_genlist_item_contents_orphan(Elm_Object_Item *it); #define ELM_IMAGE_ROTATE_90_CW 1 #define ELM_IMAGE_ROTATE_180_CW 2 diff --git a/legacy/elementary/src/lib/elm_genlist.c b/legacy/elementary/src/lib/elm_genlist.c index 5006cd715d..14d7fdcbf5 100644 --- a/legacy/elementary/src/lib/elm_genlist.c +++ b/legacy/elementary/src/lib/elm_genlist.c @@ -4953,8 +4953,14 @@ elm_genlist_item_icons_orphan(Elm_Object_Item *it) elm_genlist_item_contents_orphan(it); } -EAPI void +EINA_DEPRECATED EAPI void elm_genlist_item_contents_orphan(Elm_Object_Item *it) +{ + elm_genlist_item_all_contents_unset(it, NULL); +} + +EAPI void +elm_genlist_item_all_contents_unset(Elm_Object_Item *it, Eina_List **l) { ELM_OBJ_ITEM_CHECK_OR_RETURN(it); @@ -4964,6 +4970,8 @@ elm_genlist_item_contents_orphan(Elm_Object_Item *it) elm_widget_sub_object_del(WIDGET(it), content); evas_object_smart_member_del(content); evas_object_hide(content); + if (l) + *l = eina_list_append(*l, content); } } diff --git a/legacy/elementary/src/lib/elm_genlist.h b/legacy/elementary/src/lib/elm_genlist.h index eb913195cb..654d32826a 100644 --- a/legacy/elementary/src/lib/elm_genlist.h +++ b/legacy/elementary/src/lib/elm_genlist.h @@ -1753,9 +1753,10 @@ EAPI void elm_genlist_item_display_only_set(Elm_Object_ EAPI Eina_Bool elm_genlist_item_display_only_get(const Elm_Object_Item *it); /** - * Tells genlist to "orphan" contents fetched by the item class + * Unset all contents fetched by the item class * * @param it The item + * @param l The contents list to return * * This instructs genlist to release references to contents in the item, * meaning that they will no longer be managed by genlist and are @@ -1764,8 +1765,7 @@ EAPI Eina_Bool elm_genlist_item_display_only_get(const Elm_O * * @ingroup Genlist */ -//XXX: Eina_List *elm_genlist_item_all_contents_unset() ?? -EAPI void elm_genlist_item_contents_orphan(Elm_Object_Item *it); +EAPI void elm_genlist_item_all_contents_unset(Elm_Object_Item *it, Eina_List **l); /** * Promote an item to the top of the list