Hi Hermet,

These checks won't work. parent is an Eo object, no more some item
structure. You can't just cast the object to a Gen_Item (that is the
item structure). You have to use ELM_GENLIST_ITEM_DATA_GET to retrieve
the parent data.

Why don't you just eo_isa the parent with ELM_GENLIST_ITEM_CLASS (or
smth like that) ?

D2

On 01/07/15 08:46, ChunEon Park wrote:
> hermet pushed a commit to branch master.
>
> http://git.enlightenment.org/core/elementary.git/commit/?id=cebc6835bc2c00915b7ff67f1575f1f83dd57fa4
>
> commit cebc6835bc2c00915b7ff67f1575f1f83dd57fa4
> Author: ChunEon Park <her...@hermet.pe.kr>
> Date:   Wed Jan 7 15:49:19 2015 +0900
>
>     genlist: + parent validation check
> ---
>  src/lib/elm_genlist.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
> index 796d040..c173626 100644
> --- a/src/lib/elm_genlist.c
> +++ b/src/lib/elm_genlist.c
> @@ -6211,11 +6211,17 @@ _elm_genlist_item_insert_before(Eo *obj EINA_UNUSED, 
> Elm_Genlist_Data *sd, const
>  }
>  
>  EOLIAN static Elm_Object_Item*
> -_elm_genlist_item_sorted_insert(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, 
> const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, 
> Elm_Genlist_Item_Type type, Eina_Compare_Cb comp, Evas_Smart_Cb func, const 
> void *func_data)
> +_elm_genlist_item_sorted_insert(Eo *obj, Elm_Genlist_Data *sd, const 
> Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, 
> Elm_Genlist_Item_Type type, Eina_Compare_Cb comp, Evas_Smart_Cb func, const 
> void *func_data)
>  {
>     Elm_Gen_Item *rel = NULL;
>     Elm_Gen_Item *it;
>  
> +   if (parent)
> +     {
> +        ELM_GENLIST_ITEM_CHECK_OR_RETURN(((Elm_Gen_Item *)parent), NULL);
> +        EINA_SAFETY_ON_FALSE_RETURN_VAL(obj == WIDGET(((Elm_Gen_Item 
> *)parent)), NULL);
> +     }
> +
>     it = _elm_genlist_item_new
>         (sd, itc, data, parent, type, func, func_data);
>     if (!it) return NULL;
>


------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to