uh im late. Seoz fixed. it.
thanks for report.
------------------------------------
-Regards, Hermet-

-----Original Message-----
From: "Gustavo Lima Chaves"<gl...@profusion.mobi> 
To: "Enlightenment developer list"<enlightenment-devel@lists.sourceforge.net>; 
Cc: 
Sent: 2014-01-22 (수) 22:17:44
Subject: Re: [E-devel] [EGIT] [core/elementary] master 01/01: [naviframe] Fix 
to enable item deletion in pop_cb

* Jaehyun Cho <jae_hyun.cho>@samsung.com> [2014-01-22 05:14:53 -0800]:

> hermet pushed a commit to branch master.
> 
> http://git.enlightenment.org/core/elementary.git/commit/?id=bb39f8616f682af873ccf407086f8ce092369a11
> 
> commit bb39f8616f682af873ccf407086f8ce092369a11
> Author: Jaehyun Cho <jae_hyun.cho>@samsung.com>
> Date:   Wed Jan 22 22:13:51 2014 +0900
> 
>     [naviframe] Fix to enable item deletion in pop_cb
>     
>     Summary: Fix to enable item deletion in the registered pop_cb function
>     
>     Reviewers: Hermet
>     
>     Reviewed By: Hermet
>     
>     CC: seoz
>     
>     Differential Revision: https://phab.enlightenment.org/D487
> ---
>  src/lib/elc_naviframe.c         15 +++++++++++++++
>  src/lib/elm_widget_naviframe.h   2 ++
>  2 files changed, 17 insertions(+)
> 
> diff --git a/src/lib/elc_naviframe.c b/src/lib/elc_naviframe.c
> index a2a1f85..c89fd0a 100644
> --- a/src/lib/elc_naviframe.c
> +++ b/src/lib/elc_naviframe.c
> @@ -504,6 +504,9 @@ _item_del_pre_hook(Elm_Object_Item *it)
>     nit = (Elm_Naviframe_Item *)it;
>     ELM_NAVIFRAME_DATA_GET(WIDGET(nit), sd);
>  
> +   nit->delete_me = EINA_TRUE;
> +   if (nit->ref > 0) return EINA_FALSE;
> +
>     ecore_animator_del(nit->animator);
>  
>     top = (it == elm_naviframe_top_item_get(WIDGET(nit)));
> @@ -1696,14 +1699,26 @@ _item_pop(Eo *obj, void *_pd, va_list *list)
>     if (it->popping) return;
>     it->popping = EINA_TRUE;
>  
> +   evas_object_ref(obj);
>     if (it->pop_cb)
>       {
> +        it->ref++;
>          if (!it->pop_cb(it->pop_data, (Elm_Object_Item *)it))
>            {
> +             it->ref--;
> +             if (it->delete_me)
> +               {
> +                  _item_del_pre_hook(it);
> +                  _elm_widget_item_free(it);

Would you please exchange all calls to this couple of functions by the
equally working elm_widget_item_del()?

> +               }
>               it->popping = EINA_FALSE;
> +             evas_object_unref(obj);
> +
>               return;
>            }
> +        it->ref--;
>       }
> +   evas_object_unref(obj);
>  
>     if (sd->preserve)
>       content = it->content;
> diff --git a/src/lib/elm_widget_naviframe.h b/src/lib/elm_widget_naviframe.h
> index 83809f9..1b4d3fc 100644
> --- a/src/lib/elm_widget_naviframe.h
> +++ b/src/lib/elm_widget_naviframe.h
> @@ -57,6 +57,8 @@ struct _Elm_Naviframe_Item
>     Eina_Bool    title_enabled : 1;
>     Eina_Bool    unfocusable : 1;
>     Eina_Bool    popping : 1;
> +   Eina_Bool    delete_me : 1;
> +   int          ref;
>  };
>  
>  typedef struct _Elm_Naviframe_Content_Item_Pair 
> Elm_Naviframe_Content_Item_Pair;
> 
> -- 
> 
> 

-- 
Gustavo Lima Chaves
Senior Developer @ Intel - Open Source Technology Center

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to