Adds the possibility to either append or prepend a child in a
model. The position requested may be ignored by the data model
depending on how ordering is defined.
patch looks good to me, but I didn't tested this yet, so I'll check again :)
Thanks for fast feedback!
I think after this,
I have been wondering for some time what should be our approach regarding append,prepend and such. My issue with this patch is that we are taking the step of adding a lot more insertion function after that. Would it be possible to have only one append and one prepend acutally with a child as a reference point? Something like :
new_child = efl_model_child_append(model, relative_to_child); new_child = efl_model_child_prepend(model, relative_to_child);
And when passing NULL for the relative_to_child, we will get the behavior we have in this patch ? I know that this patch likely break selection and boolean, but that's ok for now will investigate that later.
well...I think... , I like the way of having some default actions.
what I think is...
: insert in input index. NULL or 0 index means prepend.
: default insertion, always append.
cause I think insert_before and after is mostly meaningless excepts the edges. I really don't know why we need this two API for insertion... in some specific index.. the only the they have to do is just -1. so I prefer to have basic action for adding and some special case, insert(At).
but if you think this is better, ok, its fine.
We need an API to insert content any where in a children list. I prefer something that is consistent. So if we go with append, we need prepend as a symmetrical API. Now with insert_at, we technically don't need any symmetrical API. It is good by itself. They are also equivalent, you can implement insert_at with append/prepend. And you can implement append/prepend by using insert_at. So as they are equivalent, which one should we pick. Now that you have pointed out insert_at, I have a preference for it... because it require to implement only one API in a model instead of 2. @felipealmeida what is your opinion on this?