forked from enlightenment/efl
elementary: make sure to use the model that generated the event to fetch information from.
This commit is contained in:
parent
228ecdeb51
commit
85598a8a40
|
@ -2439,21 +2439,21 @@ _properties_ready(void *data, const Efl_Event *ev)
|
||||||
Eina_Value *value;
|
Eina_Value *value;
|
||||||
Eina_Bool is_dir = EINA_FALSE;
|
Eina_Bool is_dir = EINA_FALSE;
|
||||||
|
|
||||||
value = efl_model_property_get(pd->target, "is_dir");
|
value = efl_model_property_get(ev->object, "is_dir");
|
||||||
if (eina_value_type_get(value) != EINA_VALUE_TYPE_BOOL)
|
if (eina_value_type_get(value) != EINA_VALUE_TYPE_BOOL)
|
||||||
{
|
{
|
||||||
ERR("Unexpected type for 'is_dir': '%s' with value '%s'.", eina_value_type_get(value)->name, eina_value_to_string(value));
|
ERR("Unexpected type for 'is_dir': '%s' with value '%s'.", eina_value_type_get(value)->name, eina_value_to_string(value));
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
efl_event_callback_del(pd->target, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _properties_ready, obj);
|
efl_event_callback_del(ev->object, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _properties_ready, obj);
|
||||||
|
|
||||||
eina_value_bool_get(value, &is_dir);
|
eina_value_bool_get(value, &is_dir);
|
||||||
|
|
||||||
if (!is_dir)
|
if (!is_dir)
|
||||||
{
|
{
|
||||||
Efl_Model *parent;
|
Efl_Model *parent;
|
||||||
const char *path = eio_model_path_get(pd->target);
|
const char *path = eio_model_path_get(ev->object);
|
||||||
char *dir = ecore_file_dir_get(path);
|
char *dir = ecore_file_dir_get(path);
|
||||||
|
|
||||||
parent = efl_add_ref(EIO_MODEL_CLASS, obj, eio_model_path_set(efl_added, dir),
|
parent = efl_add_ref(EIO_MODEL_CLASS, obj, eio_model_path_set(efl_added, dir),
|
||||||
|
@ -2467,14 +2467,14 @@ _properties_ready(void *data, const Efl_Event *ev)
|
||||||
}
|
}
|
||||||
efl_model_children_count_get(parent);
|
efl_model_children_count_get(parent);
|
||||||
|
|
||||||
_schedule_populate(obj, pd, parent, pd->target);
|
_schedule_populate(obj, pd, parent, ev->object);
|
||||||
efl_unref(parent);
|
efl_unref(parent);
|
||||||
free(dir);
|
free(dir);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
efl_model_children_count_get(pd->target);
|
efl_model_children_count_get(ev->object);
|
||||||
_schedule_populate(obj, pd, pd->target, NULL);
|
_schedule_populate(obj, pd, ev->object, NULL);
|
||||||
}
|
}
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue