forked from enlightenment/efl
ecore: use new infrastructure for Efl.CompositeModel to only have one Model object represent its data at any point in time.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D8660
This commit is contained in:
parent
eb8511ce7b
commit
13b230029d
|
@ -252,6 +252,20 @@ struct _Efl_Composite_Model_Slice_Request
|
||||||
unsigned int dummy_need;
|
unsigned int dummy_need;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static Efl_Model *
|
||||||
|
_efl_composite_lookup(const Efl_Class *self, Eo *parent, Efl_Model *view, unsigned int index)
|
||||||
|
{
|
||||||
|
EFL_COMPOSITE_LOOKUP_RETURN(remember, parent, view, "_efl.composite_model");
|
||||||
|
|
||||||
|
remember = efl_add_ref(self, parent,
|
||||||
|
efl_ui_view_model_set(efl_added, view),
|
||||||
|
efl_composite_model_index_set(efl_added, index),
|
||||||
|
efl_loop_model_volatile_make(efl_added));
|
||||||
|
if (!remember) return NULL;
|
||||||
|
|
||||||
|
EFL_COMPOSITE_REMEMBER_RETURN(remember, view);
|
||||||
|
}
|
||||||
|
|
||||||
static Eina_Value
|
static Eina_Value
|
||||||
_efl_composite_model_then(Eo *o EINA_UNUSED, void *data, const Eina_Value v)
|
_efl_composite_model_then(Eo *o EINA_UNUSED, void *data, const Eina_Value v)
|
||||||
{
|
{
|
||||||
|
@ -266,13 +280,8 @@ _efl_composite_model_then(Eo *o EINA_UNUSED, void *data, const Eina_Value v)
|
||||||
{
|
{
|
||||||
Eo *composite;
|
Eo *composite;
|
||||||
|
|
||||||
// First set the Model to be used as a source so that we the newly object
|
// Fetch an existing composite model for this model or create a new one if none exist
|
||||||
// can know if it needs to retain the information regarding its index.
|
composite = _efl_composite_lookup(req->self, req->parent, target, req->start + i);
|
||||||
composite = efl_add_ref(req->self, req->parent,
|
|
||||||
efl_ui_view_model_set(efl_added, target),
|
|
||||||
efl_composite_model_index_set(efl_added, req->start + i),
|
|
||||||
efl_loop_model_volatile_make(efl_added));
|
|
||||||
|
|
||||||
eina_value_array_append(&r, composite);
|
eina_value_array_append(&r, composite);
|
||||||
// Dropping this scope reference
|
// Dropping this scope reference
|
||||||
efl_unref(composite);
|
efl_unref(composite);
|
||||||
|
|
Loading…
Reference in New Issue