Re: [E-devel] [EGIT] [core/elementary] master 01/02: spinner: Remove unnecessary temporary variable.

2015-08-20 Thread Daniel Juyung Seo
Hi Vyacheslav Reutskiy,

That's a good question.
Currently we're taking this approach.
- xxx_widget_theme_apply() returns only when there is a critical
problem like failing on fetching widget data which could imply memory
corruption.
- xxx_widget_theme_apply() will continue working even though
elm_layout_theme_set() fails so other remaining logic should just
work. But we spit out ciritical log message.
This is how all the widgets are designed at this moment. Spinner was alien.

However, because most of the remaining logic in elm_layout_theme_set()
would depend on the elm_layout_theme_set(), we could just return if it
fails. But we need to change all the widgets' codes.

This might be a good topic to discuss.

Thanks,
Daniel (SeoZ)

On Tue, Aug 18, 2015 at 1:22 PM, Vyacheslav Reutskiy
reutskiy@gmail.com wrote:
 Daniel, I'm not sure that is good. With yours changes this function always
 return EINA_TRUE. How do I know that the widget theme apply is successful?

 On Mon, Aug 17, 2015 at 6:42 PM, Daniel Juyung Seo seojuyu...@gmail.com
 wrote:

 seoz pushed a commit to branch master.


 http://git.enlightenment.org/core/elementary.git/commit/?id=55d5a67d4ff13ca5544f44b8518a0998b6a65333

 commit 55d5a67d4ff13ca5544f44b8518a0998b6a65333
 Author: Daniel Juyung Seo seojuyu...@gmail.com
 Date:   Tue Aug 18 00:20:02 2015 +0900

 spinner: Remove unnecessary temporary variable.

 Follow elm_layout_theme_set usage convention.
 ---
  src/lib/elm_spinner.c | 7 +++
  1 file changed, 3 insertions(+), 4 deletions(-)

 diff --git a/src/lib/elm_spinner.c b/src/lib/elm_spinner.c
 index 2130ffe..f0a8d2f 100644
 --- a/src/lib/elm_spinner.c
 +++ b/src/lib/elm_spinner.c
 @@ -1107,10 +1107,9 @@ EOLIAN static Eina_Bool
  _elm_spinner_elm_widget_theme_apply(Eo *obj, Elm_Spinner_Data *sd)
  {
 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
 -   Eina_Bool int_ret = elm_layout_theme_set(obj, spinner, base,
 -  elm_widget_style_get(obj));

 -   if (!int_ret) CRI(Failed to set layout!);
 +   if (!elm_layout_theme_set(obj, spinner, base,
 elm_widget_style_get(obj)))
 + CRI(Failed to set layout!);

 if (edje_object_part_exists(wd-resize_obj, elm.swallow.dec_button))
   sd-button_layout = EINA_TRUE;
 @@ -1153,7 +1152,7 @@ _elm_spinner_elm_widget_theme_apply(Eo *obj,
 Elm_Spinner_Data *sd)
   _access_spinner_register(obj, EINA_TRUE);

 elm_layout_sizing_eval(obj);
 -   return int_ret;
 +   return EINA_TRUE;
  }

  static Eina_Bool _elm_spinner_smart_focus_next_enable = EINA_FALSE;

 --



 --
 ___
 enlightenment-devel mailing list
 enlightenment-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/enlightenment-devel



-- 
Daniel Juyung Seo (SeoZ)

--
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [EGIT] [core/elementary] master 01/02: spinner: Remove unnecessary temporary variable.

2015-08-17 Thread Vyacheslav Reutskiy
Daniel, I'm not sure that is good. With yours changes this function always
return EINA_TRUE. How do I know that the widget theme apply is successful?

On Mon, Aug 17, 2015 at 6:42 PM, Daniel Juyung Seo seojuyu...@gmail.com
wrote:

 seoz pushed a commit to branch master.


 http://git.enlightenment.org/core/elementary.git/commit/?id=55d5a67d4ff13ca5544f44b8518a0998b6a65333

 commit 55d5a67d4ff13ca5544f44b8518a0998b6a65333
 Author: Daniel Juyung Seo seojuyu...@gmail.com
 Date:   Tue Aug 18 00:20:02 2015 +0900

 spinner: Remove unnecessary temporary variable.

 Follow elm_layout_theme_set usage convention.
 ---
  src/lib/elm_spinner.c | 7 +++
  1 file changed, 3 insertions(+), 4 deletions(-)

 diff --git a/src/lib/elm_spinner.c b/src/lib/elm_spinner.c
 index 2130ffe..f0a8d2f 100644
 --- a/src/lib/elm_spinner.c
 +++ b/src/lib/elm_spinner.c
 @@ -1107,10 +1107,9 @@ EOLIAN static Eina_Bool
  _elm_spinner_elm_widget_theme_apply(Eo *obj, Elm_Spinner_Data *sd)
  {
 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
 -   Eina_Bool int_ret = elm_layout_theme_set(obj, spinner, base,
 -  elm_widget_style_get(obj));

 -   if (!int_ret) CRI(Failed to set layout!);
 +   if (!elm_layout_theme_set(obj, spinner, base,
 elm_widget_style_get(obj)))
 + CRI(Failed to set layout!);

 if (edje_object_part_exists(wd-resize_obj, elm.swallow.dec_button))
   sd-button_layout = EINA_TRUE;
 @@ -1153,7 +1152,7 @@ _elm_spinner_elm_widget_theme_apply(Eo *obj,
 Elm_Spinner_Data *sd)
   _access_spinner_register(obj, EINA_TRUE);

 elm_layout_sizing_eval(obj);
 -   return int_ret;
 +   return EINA_TRUE;
  }

  static Eina_Bool _elm_spinner_smart_focus_next_enable = EINA_FALSE;

 --



--
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel