<br><br><div class="gmail_quote">On Tue, May 18, 2010 at 4:07 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: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On 05/18/2010 12:30 PM, Vishesh Handa wrote:<br>
&gt;     2. Don&#39;t we need to protect m_resources via a QMutex?<br>
&gt;<br>
&gt;<br>
&gt; I&#39;m currently blissfully unaware about concurrent programming. I assure<br>
&gt; you I&#39;m trying to learn, but till then could you take care of it?<br>
<br>
</div>ok, will do.<br>
<div class="im"><br>
&gt;     [3. Wouldn&#39;t shoudBeDeleted() make more sense in<br>
&gt;     ResourceManagerPrivate?]<br>
&gt;<br>
&gt; :-/ It checks if a ResourceData should be deleted. I considered making<br>
&gt; it static but this approach had less clutter. Could you please explain<br>
&gt; why it should be in ResourceManagerPrivate?<br>
<br>
</div>I thought that conceptually it is the resourcemanager maintaining the<br>
resourcedata objects. So it should also be the one to decide when one<br>
has to be deleted.<br></blockquote><div><br>Okay. I&#39;ve changed it.<br><br>The shouldBeDeleted function is currently called twice. Two times in Resource (destructor and operator==), and once in ResourceData::replaceWith.<br>
<br>- Vishesh Handa<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5"><br>
&gt;     As for ResourceManagerPrivate: this is just how it is done in KDE: it is<br>
&gt;     a convention to name private classes that way. You can look in KDE and<br>
&gt;     Qt code all over the place and find these private classes. Their main<br>
&gt;     purpose is to keep as much member variables and methods out of the main<br>
&gt;     class as possible to make it possible to add and remove those without<br>
&gt;     breaking binary compatibility.<br>
&gt;<br>
&gt;<br>
&gt; Yea. I know. The &quot;pimpl&quot; idiom. :)<br>
&gt;<br>
&gt;     I will apply the patch and test it.<br>
&gt;<br>
&gt; Okay. I&#39;ll do the same.<br>
&gt;<br>
&gt; - Vishesh Handa<br>
&gt;<br>
&gt;<br>
&gt;     Cheers,<br>
&gt;     Sebastian<br>
&gt;<br>
&gt;     On 05/16/2010 04:11 PM, Vishesh Handa wrote:<br>
&gt;     &gt; Cleaned up the code a little bit.<br>
&gt;     &gt; - fixed a small bug in Resource::~Resource(). (my fault)<br>
&gt;     &gt; - m_resources is now managed along with reference counting.<br>
&gt;     &gt; - Added a function ResourceData::shouldBeDeleted() to avoid<br>
&gt;     duplication<br>
&gt;     &gt; of code.<br>
&gt;     &gt;<br>
&gt;     &gt; I think the shouldBeDeleted() function should be in another patch.<br>
&gt;     &gt;<br>
&gt;     &gt; Btw, this code still hasn&#39;t been extensively tested. I&#39;ll do the<br>
&gt;     testing<br>
&gt;     &gt; later on. I just though I should share the patch so that I can get<br>
&gt;     your<br>
&gt;     &gt; comments.<br>
&gt;     &gt;<br>
&gt;     &gt; - Vishesh Handa<br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br>