On Fri, Nov 15, 2013 at 10:33 PM, Stefan Schmidt
<ste...@datenfreihafen.org>wrote:

> Hello.
>
> On Fri, 2013-11-08 at 04:53, Daniel Juyung Seo wrote:
> > seoz pushed a commit to branch master.
> >
> >
> http://git.enlightenment.org/core/elementary.git/commit/?id=6a683df1598a4c3293a33765cc60dde89b616f2f
> >
> > commit 6a683df1598a4c3293a33765cc60dde89b616f2f
> > Author: Daniel Juyung Seo <seojuyu...@gmail.com>
> > Date:   Fri Nov 8 21:49:52 2013 +0900
> >
> >     button,inwin,radio,scroller,slider: Do not call smart_activate when
> the widget is disabled.
> > ---
> >  src/lib/elm_button.c   | 10 ++++------
> >  src/lib/elm_inwin.c    |  2 ++
> >  src/lib/elm_radio.c    |  1 +
> >  src/lib/elm_scroller.c |  4 ++--
> >  src/lib/elm_slider.c   |  4 ++--
> >  5 files changed, 11 insertions(+), 10 deletions(-)
> >
> > diff --git a/src/lib/elm_button.c b/src/lib/elm_button.c
> > index 835ba32..d89916f 100644
> > --- a/src/lib/elm_button.c
> > +++ b/src/lib/elm_button.c
> > @@ -82,14 +82,12 @@ _elm_button_smart_activate(Eo *obj, void *_pd
> EINA_UNUSED, va_list *list)
> >     Eina_Bool *ret = va_arg(*list, Eina_Bool *);
> >     if (ret) *ret = EINA_FALSE;
> >
> > +   if (elm_widget_disabled_get(obj)) return;
> >     if (act != ELM_ACTIVATE_DEFAULT) return;
> > +   if (evas_object_freeze_events_get(obj)) return;
> >
> > -   if (!elm_widget_disabled_get(obj) &&
> > -       !evas_object_freeze_events_get(obj))
> > -     {
> > -        evas_object_smart_callback_call(obj, SIG_CLICKED, NULL);
> > -        elm_layout_signal_emit(obj, "elm,anim,activate", "elm");
> > -     }
> > +   evas_object_smart_callback_call(obj, SIG_CLICKED, NULL);
> > +   elm_layout_signal_emit(obj, "elm,anim,activate", "elm");
> >
> >     if (ret) *ret = EINA_TRUE;
> >  }
> > diff --git a/src/lib/elm_inwin.c b/src/lib/elm_inwin.c
> > index 8d7ed11..16696bc 100644
> > --- a/src/lib/elm_inwin.c
> > +++ b/src/lib/elm_inwin.c
> > @@ -140,6 +140,8 @@ _elm_inwin_smart_activate(Eo *obj, void *_pd
> EINA_UNUSED, va_list *list EINA_UNU
> >  {
> >     ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
> >
> > +   if (elm_widget_disabled_get(obj)) return;
> > +
> >     evas_object_raise(obj);
> >     evas_object_show(obj);
> >     edje_object_signal_emit
> > diff --git a/src/lib/elm_radio.c b/src/lib/elm_radio.c
> > index 6883784..d30d6cc 100644
> > --- a/src/lib/elm_radio.c
> > +++ b/src/lib/elm_radio.c
> > @@ -526,6 +526,7 @@ _elm_radio_smart_activate(Eo *obj, void *_pd
> EINA_UNUSED, va_list *list)
> >     Eina_Bool *ret = va_arg(*list, Eina_Bool *);
> >     if (ret) *ret = EINA_FALSE;
> >
> > +   if (elm_widget_disabled_get(obj)) return;
> >     if (act != ELM_ACTIVATE_DEFAULT) return;
> >
> >     _activate(obj);
> > diff --git a/src/lib/elm_scroller.c b/src/lib/elm_scroller.c
> > index 0107121..48ffa5c 100644
> > --- a/src/lib/elm_scroller.c
> > +++ b/src/lib/elm_scroller.c
> > @@ -270,8 +270,8 @@ _elm_scroller_smart_activate(Eo *obj, void *_pd
> EINA_UNUSED, va_list *list)
> >     Evas_Coord page_x = 0;
> >     Evas_Coord page_y = 0;
> >
> > -   if ((elm_widget_disabled_get(obj)) ||
> > -       (act == ELM_ACTIVATE_DEFAULT)) return;
> > +   if (elm_widget_disabled_get(obj)) return;
> > +   if (act != ELM_ACTIVATE_DEFAULT) return;
>
> At least this part destroys the logic of the code following in this
> function.
>
> With your change we return directly for everything but
> ELM_ACTIVATE_RIGHT. Which means that act can not be anything else from
> now on but we check for various other values of act later on.
>
> Coverity identifies this as dead code while I think this check might
> be wrong. You can also have a look at 1128353.
>
> The same could be true for the other funtions you changed here. I have
> not reviewed them.
>
>
Great catch! It was a copy and paste bug from me.
Sorry but thanks a lot to Stefan and coverity.
Just fixed that.
Thanks.

Daniel Juyung Seo (SeoZ)

regards
> Stefan Schmidt
>
>
> ------------------------------------------------------------------------------
> DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
> OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
> Free app hosting. Or install the open source package on any LAMP server.
> Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
> http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
> _______________________________________________
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>
------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&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