Re: [Multi-valued V2 (grilo) 11/12] core: Merge GrlDataMulti into GrlData
- From: "Juan A." Suárez Romero <jasuarez igalia com>
- To: grilo-list gnome org
- Subject: Re: [Multi-valued V2 (grilo) 11/12] core: Merge GrlDataMulti into GrlData
- Date: Thu, 03 Mar 2011 10:39:36 +0100
On Thu, 2011-03-03 at 09:15 +0000, Iago Toral wrote:
> > We can discuss if we can get rid of some of this functions, but that
> > would change the API, so I prefer to keep it as it is, at least for
> > some
> > time, after we think which functions can be removed, and what
> > functions
> > should be renamed.
>
> No, it won't change the API.
> What I am saying is that we should have grl_data_remove *only* but
> its
> implementation should be that of grl_data_remove_property and we
> should
> not have grl_data_remove_property, of course.
Currently we have:
void grl_data_remove (GrlData *data, GrlKeyID key);
void grl_data_remove_related_keys (GrlData *data, GrlKeyID key, guint
index);
The first one is invoking second one with index == 0.
If we want to keep the first one only, we would need to add the index
parameter, and hence changing the api.
> >
> >> > But users can still remove a specific element if they really
> want:
> >> > get
> >> > the property with the element, and then remove the key from that
> >> > property.
> >>
> >> Shouldn't we remove that API from GrlProperty then?
> >
> > The API to remove the key in GrlProperty is there to implement the
> > grl_data_remove(), which acts on single-values (i.e., the first
> value
> > of
> > multi-valued keys).
>
> If it is there for internal use as you suggest here, then that's
> fine
> with me, but then it should not be part of the public API, since as
> I
> said, its use by clients could break the semantics of the related
> keys,
> and I don't really see a good reason why they would like to use this
> instead of grl_data_remove (updated to deal with related keys)
>
> > Of course, I can still get rid of it, as doing
> >
> > grl_property_remove(prop, key)
> >
> > is almost the same as
> >
> > grl_property_set (prop, key, NULL)
>
> But this is not exactly the same, as grl_property_set would actually
> leave the key with NULL value.
Fair enough. I'll remove the function.
J.A.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]