[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: kdelibs/kio/bookmarks
From:       Frerich Raabe <raabe () kde ! org>
Date:       2005-02-10 6:15:25
Message-ID: 200502100715.35011.raabe () kde ! org
[Download RAW message or body]


On Wednesday 09 February 2005 12:33, David Faure wrote:
> On Wednesday 09 February 2005 08:59, Frerich Raabe wrote:
> > On Monday 07 February 2005 12:50, you wrote:
> > > On Monday 31 January 2005 02:37, you wrote:
> > > > +bool KBookmark::hasMetaData() const
> > > >  {
> > > >      QDomNode n = cd_or_create( internalElement(), "info" );
> > > >      n = findOrCreateMetadata( n );
> > > > +    return !n.firstChild().isNull();
> > >
> > > Creating an info or a metadata element from a const method looks rather
> > > wrong to me.
> >
> > How does it change the *observeable* state of the object?
>
> I'm not nitpicking on const semantics.
> I'm pointing out that your "hasMetaData" method creates <info> and
> <metadata>, which obviously looks wrong: if the node didn't have metadata,
> there's no point in creating those elements; this just bloats the XML.

This is IMHO just a minor nuisance. For what it's worth, a bookmark which has 
something like '<info><metadata/></info>' is not considered to have metadata 
(hence this function didn't create any meta data) - having the element alone 
is not sufficient, it has to have child elements as well.

If you really want, I'll go and change it so that it first check whether the 
element exists already, but I don't feel guilty enough for this little waste 
of bytes to do it otherwise. :-]

- Frerich

-- 
Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"

[Attachment #3 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic