[Nepomuk] Nepomuk Core - Questions & Patches

Sebastian Trüg trueg at kde.org
Tue May 18 12:37:58 CEST 2010


On 05/18/2010 12:30 PM, Vishesh Handa wrote:
>     2. Don't we need to protect m_resources via a QMutex?
> 
> 
> I'm currently blissfully unaware about concurrent programming. I assure
> you I'm trying to learn, but till then could you take care of it?

ok, will do.

>     [3. Wouldn't shoudBeDeleted() make more sense in
>     ResourceManagerPrivate?]
> 
> :-/ It checks if a ResourceData should be deleted. I considered making
> it static but this approach had less clutter. Could you please explain
> why it should be in ResourceManagerPrivate?

I thought that conceptually it is the resourcemanager maintaining the
resourcedata objects. So it should also be the one to decide when one
has to be deleted.

>     As for ResourceManagerPrivate: this is just how it is done in KDE: it is
>     a convention to name private classes that way. You can look in KDE and
>     Qt code all over the place and find these private classes. Their main
>     purpose is to keep as much member variables and methods out of the main
>     class as possible to make it possible to add and remove those without
>     breaking binary compatibility.
> 
> 
> Yea. I know. The "pimpl" idiom. :)
> 
>     I will apply the patch and test it.
> 
> Okay. I'll do the same.
> 
> - Vishesh Handa
>  
> 
>     Cheers,
>     Sebastian
> 
>     On 05/16/2010 04:11 PM, Vishesh Handa wrote:
>     > Cleaned up the code a little bit.
>     > - fixed a small bug in Resource::~Resource(). (my fault)
>     > - m_resources is now managed along with reference counting.
>     > - Added a function ResourceData::shouldBeDeleted() to avoid
>     duplication
>     > of code.
>     >
>     > I think the shouldBeDeleted() function should be in another patch.
>     >
>     > Btw, this code still hasn't been extensively tested. I'll do the
>     testing
>     > later on. I just though I should share the patch so that I can get
>     your
>     > comments.
>     >
>     > - Vishesh Handa
> 
> 


More information about the Nepomuk mailing list