text:id is deprecated

Thorsten Zachmann t.zachmann at zagge.de
Thu Dec 15 04:49:58 GMT 2011


Hello,

On Wednesday, December 14, 2011 16:21:53 Boudewijn Rempt wrote:
> On Wednesday 14 December 2011 Dec, C. Boemann wrote:
> > all well, except how do the animation framework get the related qobject
> > from this?
> 
> I'm not sure how that works now, I guess they use the xml:id or draw:id as
> a qstring key into a map. So then it should use the reference, not the id
> string itself as a key into that map.
> 
> The thing is that we've got all these QString id's around that have weird
> and meaningful formats -- rdf-uuid, ftn-number and so on, and now we have
> to share the xml:id's among different maps, so the id cannot have any
> meaning anymore and should be replaced by a uuid.
> 
> Now the tricky part I'm running into is that sometimes we assume that if
> there's an xml:id present, it _must_ mean there's some bit of rdf, like
> this bit of code in KoBookmark::loadOdf:
> 
>             // Add inline Rdf to the bookmark.
>             if (element.hasAttributeNS(KoXmlNS::xhtml, "property") ||
> element.hasAttribute("id")) { KoTextInlineRdf* inlineRdf = new
> KoTextInlineRdf(const_cast<QTextDocument*>(d->document), this); if
> (inlineRdf->loadOdf(element)) {
>                     setInlineRdf(inlineRdf);
>                 }
>             }
> 
> and I'm still not sure how to fix that -- maybe check whether there's rdf
> in the manifest.rdf with the same id. (I'm also not sure why it's
> "element.hasAttribute("id"), not element.hasAttribute("xml:id") or
> element.hasAttributeNS("KoXmlNS::xml, "id"))

for me this looks like a bit of overkill. Let me explain how the id stuff in 
the animations work. The xml id is not kept. It is only used during loading to 
be able to get the thinks it refers to. The e.g. we get us the shape for the 
id and store the shape. The when writing out the stuff a id is generated and we 
get the id again. During the runtime of the program the xml:id is not usefull 
at all. That is also the case for the places where the other id's are used.

Maybe the rdf stuff can use a same mechanism. That would also solve your 
problem that it thinks all xml:id tags are used for rdf.

Sure when writing out the id's we need to make sure they are uniqe. But 
instead of having the very long id's I would prefer to have speeking id's 
where one knows what it is about.

Thorsten



More information about the calligra-devel mailing list