<br><div class="gmail_quote">On Sun, May 23, 2010 at 8:20 PM, Sebastian Trüg <span dir="ltr"><<a href="mailto:trueg@kde.org">trueg@kde.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On 05/23/2010 04:23 PM, Vishesh Handa wrote:<br>
> > One way of solving both the problems is to derive ResourceData from<br>
> > QObject. And then call deleteLater() instead of "delete this". (Patch<br>
> > attached)<br>
><br>
> oh, no, please don't. Totally useless overhead. It is much simpler to<br>
> make the mutex recursive.<br>
><br>
><br>
> Well then we need a better way of solving the "delete this" problem.<br>
> When you say moving "it" into Resource, do you mean determineUri() or<br>
> replaceWith() ?<br>
<br>
</div>I mean all calls of determineUri().<br>
Example:<br>
ResourceData::removeProperty calls determineUri. Instead determineUri<br>
should be called in Resource::removeProperty.<br></blockquote><div><br>I'm sorry. I don't understand. Isn't it the same thing? If A calls B or B is called inside A?<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
The only problem here is load. But I recently thought that it could be<br>
merged into determineUri (or the other way around). After all most<br>
resources do not have more than - say - 20 properties. That is quickly<br>
loaded and would avoid performing yet another query. What I mean is that<br>
in determineUri<br>
<br>
select distinct ?r ?o where {<br>
{ ?r nie:url <uri> . }<br>
UNION { <uri> ?p ?o . } } LIMIT 1<br>
<br>
could become something like<br>
<br>
select distinct ?r ?pp ?oo where {<br>
{ ?r nie:url <uri> .<br>
?r ?pp ?oo . FILTER(?r!=<uri> . }<br>
UNION { <uri> ?p ?o . <uri> ?pp ?oo . }<br>
<br>
to determine the URI AND load all properties at the same time.<br>
Just an idea I had when I thought about ways to spped it all up...<br></blockquote><div><br>Seems logical. But then you call determineUri everywhere? I guess we could make it determineAndLoad(). :-)<br><br>---------------------------<br>
<br>I had another idea on how to get rid of the proxy mess. I was going to tell you about it later, as its aim was to get rid of the nasty lists and determineUri mess, but it seems as though it would solve the proxy problem as well. (Nice side effect!)<br>
<br>The ResourceManagerPrivate has 2 sets of lists. I'm going to call them INIT-LIST (m_initializedData) and the HALF-INIT list (m_uriKickoffData & m_idKickoffData). Whenever a Resource is created by the RMP::data() function, it checks if it is present INIT-LIST or HALF-init list, and accordingly gives us a RD (ResourceData).<br>
<br>A RD can go into the HALF-INIT lists in 4 ways - (look at determineUri)<br>--- KickOffId<br>------- nepomuk://res/ stored as a string<br>------- nao:identifier <br><br>--- KickOffUri<br>-------- nie:url<br>-------- nepomuk://res/ <br>
<br><b>Proposal :</b> <br>Remove the KickOffId completely. And make KickOffUri contain the nao:identifier as well. When determineUri is being called, say m_kickOffUri is the nepomuk resource uri, it should add itself to the INIT-LIST and it should add all other ways of getting Initialized to the HALF-INIT list ( nao:identifier and nie:url ) This way RMP:data() will always returns the correct RD* and a proxy wouldn't be required. <br>
<br>determineUri would be a lot simpler -<br><br>if( m_kickOffUri.isValid() ) {<br> // check for nepomuk://res/<br> // check for nie:url and the filex crap which I don't understand<br>} else {<br> // check for nao:identifier<br>
}<br><br>An additional thing we could do is to make removeProperty() removing the corresponding RD from the HALF-INIT list if the property being removed is nao:identifier or nie::url. (addProperty should check for the same)/<br>
<br>I hope I've been clear enough.<br><br>- Vishesh Handa<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
Cheers,<br>
<font color="#888888">Sebastian<br>
</font></blockquote></div><br>