Yup. <div><br></div><div>You don&#39;t really need to explicitly check if m_data is not NULL, but it&#39;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">&lt;<a href="mailto:trueg@kde.org">trueg@kde.org</a>&gt;</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>
&gt; I like it, but it won&#39;t work.<br>
&gt;<br>
&gt; Due to the messy internals of Nepomuk::Resource, you&#39;ll have to<br>
&gt; call *determineFinalResourceData() *before calling<br>
&gt; ResourceData::isFile() in Resource. If you don&#39;t do that then you&#39;ll get<br>
&gt; code like this -<br>
&gt;<br>
&gt; Resource r1(&quot;nepomuk:/res/res-uuid&quot;);<br>
&gt; r1.isFile(); // will always says false even though the resource might be<br>
&gt; a file<br>
&gt; r1.rating(); // determineUri has now been called internally<br>
&gt; r1.isFile(); // now it will return true if the resource is a file<br>
&gt;<br>
&gt; If you want I could write a patch. I may be wrong, I haven&#39;t looked at<br>
&gt; 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-&gt;isFile();<br>
}<br>
else...<br>
<br>
CHeers,<br>
<font color="#888888">Sebastian<br>
</font></blockquote></div><br></div>