On 6 August 2010 09:47, Sebastian Trüg <[email protected]> wrote: > On 08/05/2010 07:45 PM, George Goldberg wrote: >> I'm having a bit of a problem with Nepomuk::Resource. The context is this: >> >> I have a query, using queryserviceclient (in this case, for all PIMO:Person). >> I also have a QList<PersonObject> where PersonObject is a class >> encapsulating a Nepomuk::Resource referencing a PIMO:Person. >> >> Whenever the queryserviceclient query emits it's newEntries() signal, >> a new PersonObject is created using that Resource and appended to the >> list. >> >> This is all fine so far. >> >> However, when the queryserviceclient query emits entriesRemoved(), I >> iterate over the list of PersonObjects, getting the Nepomuk::Resource >> from each one and comparing its uri with the one from >> entriesRemoved(). >> >> This would be fine too, except that if the resource concerned has been >> removed altogether from the Nepomuk database, the Nepomuk::Resource >> instance for it in my list has magically had its uri property set to >> "" >> >> This means that when doing the comparison, it never matches. >> >> Is this a bug? If not, can anyone suggest how I should be doing this instead? > > This is not a bug. It is a feature. :P > Seriously, that is why entriesRemoved does not return Result objects but > QUrls: the Resources are no longer valid after having been deleted. > > One solution would be your own hash of resource uris to results.
OK, I'll do that for now. Thanks, George _______________________________________________ Nepomuk mailing list [email protected] https://mail.kde.org/mailman/listinfo/nepomuk
