cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=fcd5eb755b7c97ae157ab860f284a9716d549555

commit fcd5eb755b7c97ae157ab860f284a9716d549555
Author: Cedric BAIL <cedric.b...@free.fr>
Date:   Thu Apr 18 09:34:46 2019 -0700

    ecore: allow multiple Efl.ViewModel of the same source thanks to new 
infrastructure.
    
    Reviewed-by: SangHyeon Jade Lee <sh10233....@samsung.com>
    Differential Revision: https://phab.enlightenment.org/D8657
---
 src/lib/ecore/efl_view_model.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/lib/ecore/efl_view_model.c b/src/lib/ecore/efl_view_model.c
index 7bb9a34673..dd3fefaba1 100644
--- a/src/lib/ecore/efl_view_model.c
+++ b/src/lib/ecore/efl_view_model.c
@@ -350,19 +350,14 @@ _efl_view_model_parent_data(Efl_View_Model *child, 
Efl_View_Model_Data *ppd)
 static Efl_View_Model *
 _efl_view_model_child_lookup(Efl_View_Model_Data *pd, Efl_Object *parent, 
Efl_Model *view)
 {
-   Efl_View_Model *co;
-
-   co = efl_key_wref_get(view, "_efl.view_model");
-   if (co) return co;
+   EFL_COMPOSITE_LOOKUP_RETURN(co, parent, view, "_efl.view_model");
 
    co = efl_add(EFL_VIEW_MODEL_CLASS, parent,
                 efl_ui_view_model_set(efl_added, view),
                 _efl_view_model_parent_data(efl_added, pd));
    if (!co) return NULL;
 
-   efl_key_wref_set(view, "_efl.view_model", co);
-
-   return co;
+   EFL_COMPOSITE_REMEMBER_RETURN(co, view);
 }
 
 static void

-- 


Reply via email to