Yup. <div><br></div><div>You don't really need to explicitly check if m_data is not NULL, but it's okay if you are. m_data will always have some value. <br><br><div class="gmail_quote">On Thu, Aug 5, 2010 at 7:53 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On 08/05/2010 04:05 PM, Vishesh Handa wrote:<br>
> I like it, but it won't work.<br>
><br>
> Due to the messy internals of Nepomuk::Resource, you'll have to<br>
> call *determineFinalResourceData() *before calling<br>
> ResourceData::isFile() in Resource. If you don't do that then you'll get<br>
> code like this -<br>
><br>
> Resource r1("nepomuk:/res/res-uuid");<br>
> r1.isFile(); // will always says false even though the resource might be<br>
> a file<br>
> r1.rating(); // determineUri has now been called internally<br>
> r1.isFile(); // now it will return true if the resource is a file<br>
><br>
> If you want I could write a patch. I may be wrong, I haven't looked at<br>
> the patch that carefully.<br>
<br>
</div>You are right. This is why I posted the patch. Thanks for noticing. I<br>
suppose something like the following would be enough:<br>
<br>
isFile()<br>
{<br>
if(m_data){<br>
determineFinalResourceData();<br>
return m_data->isFile();<br>
}<br>
else...<br>
<br>
CHeers,<br>
<font color="#888888">Sebastian<br>
</font></blockquote></div><br></div>