[Nepomuk] Request for comments on new Nepomuk API

Sebastian Trüg trueg at kde.org
Thu Aug 5 16:23:12 CEST 2010


On 08/05/2010 04:05 PM, Vishesh Handa wrote:
> I like it, but it won't work.
> 
> Due to the messy internals of Nepomuk::Resource, you'll have to
> call *determineFinalResourceData() *before calling
> ResourceData::isFile() in Resource. If you don't do that then you'll get
> code like this -
> 
> Resource r1("nepomuk:/res/res-uuid");
> r1.isFile(); // will always says false even though the resource might be
> a file
> r1.rating(); // determineUri has now been called internally
> r1.isFile(); // now it will return true if the resource is a file
> 
> If you want I could write a patch. I may be wrong, I haven't looked at
> the patch that carefully.

You are right. This is why I posted the patch. Thanks for noticing. I
suppose something like the following would be enough:

isFile()
{
if(m_data){
determineFinalResourceData();
return m_data->isFile();
}
else...

CHeers,
Sebastian


More information about the Nepomuk mailing list