[Nepomuk] Nepomuk Core - Questions & Patches

Vishesh Handa handa.vish at gmail.com
Sun May 9 14:37:07 CEST 2010


Some other things -

*4.* In *ResourceData::resetAll* - shouldn't *m_cacheDirty = false *be equal
to true? Considering resetAll is called when the resource is being Removed,
it shouldn't make a any difference. Still, just to be on the safer side.

*5. Error Checking: *There is considerable error checking in
Nepomuk::ResouceFilterModel where *Soprano::Error*s are returned, but after
that it all stops. Particularly in ResourceData and Resource. We could make
the Resource class return Error codes or simply boolean values in functions
like SetProperty.

That would mean additional error checking from the users side, and would
result in ugly code. This is one of cases where I would love to use
exceptions.

*6. Destructors: *Shouldn't ResourceManagerPrivate have a destructor where
it clears out the remaining ResouceData in m_initializedData and other? I
know ResourceData::resetAll removes them, but it feels wrong not to check
them just in case.

*7.* *ResourceManagerPrivate::dataCacheFull()*: Why 1000? I think this value
should be customizable.

*8.* *ResourceManager::allResourcesWithProperty*: They seem to be using a
QList internally and using the QList:contains() functions quite frequently.
Considering QList isn't sorted, i think it would be quite costly -> O(n).
How about using a QSet? The only problem is the added QSet::toList() in the
end, which shouldn't be too slow. (Max O(n)). I've provided a patch.

- Vishesh Handa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/nepomuk/attachments/20100509/f27da957/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ResourceManager_optim.diff
Type: text/x-patch
Size: 2343 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/nepomuk/attachments/20100509/f27da957/attachment.diff 


More information about the Nepomuk mailing list