[prev in list] [next in list] [prev in thread] [next in thread] 

List:       calligra-devel
Subject:    Re: Review Request 122584: Use shared pointers for markers.
From:       "Inge Wallin" <inge () lysator ! liu ! se>
Date:       2015-02-16 14:46:15
Message-ID: 20150216144615.4989.26294 () probe ! kde ! org
[Download RAW message or body]

--===============6520060829125550445==
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit



> On Feb. 16, 2015, 11:11 a.m., Inge Wallin wrote:
> > Wouldn't a much better solution be to make the Private class of the KoMarker \
> > shared? If so, we could have the collection store KoMarkers instead of a \
> > collection of KoMarker*s. Making KoMarker itself a QSharedData feels very strange \
> > and is different than anything else in Calligra.
> 
> Sven Langkamp wrote:
> That would not work. There is only one marker object in the marker collection and \
> everything else just refers by pointers. Internal reference count would always be \
> 1. 
> Inge Wallin wrote:
> Yes, but then we wouldn't have to refer by pointer anymore. Actually using the \
> objects themselves instead would be the way to do it.  
> I still say it feels very strange to make this class alone a QSharedObject and no \
> other object in Flake or libs/odf (which I think is where this class actually \
> belongs). 
> Boudewijn Rempt wrote:
> KoMarker doesn't belong in libs/odf, it's something that paints. Which also means \
> that KoMarkerCollection doesn't beloing in libs/odf. And QSharedData is used in \
> another places in flake: KoClipData.

Ah, so *that's* the distinction between libs/odf and libs/flake. I never really saw \
the logical border between them.

But did you actually look at KoClipData?  It's just the exposed internal \
implementation of KoClipPath (which also belongs in libs/odf, btw, since it doesn't \
paint). And it strengthens my point since I propose that we make the internal class \
the shared object.


- Inge


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/122584/#review76108
-----------------------------------------------------------


On Feb. 16, 2015, 2:26 a.m., Sven Langkamp wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/122584/
> -----------------------------------------------------------
> 
> (Updated Feb. 16, 2015, 2:26 a.m.)
> 
> 
> Review request for Calligra.
> 
> 
> Bugs: 343719
> http://bugs.kde.org/show_bug.cgi?id=343719
> 
> 
> Repository: calligra
> 
> 
> Description
> -------
> 
> Use shared pointers for markers.
> Currently markers crash Krita on close (bug 343719). The problem is that existing \
> path shapes point to the marker even after it's deleted. The patch solves that by \
> using shared pointers for the marker. 
> 
> Diffs
> -----
> 
> libs/flake/KoMarkerData.cpp 247e151 
> libs/flake/KoMarker.h fa2adfd 
> libs/flake/KoMarkerCollection.h 1555363 
> libs/flake/KoMarkerCollection.cpp 98e80f8 
> 
> Diff: https://git.reviewboard.kde.org/r/122584/diff/
> 
> 
> Testing
> -------
> 
> Tested with Krita.
> 
> 
> Thanks,
> 
> Sven Langkamp
> 
> 


--===============6520060829125550445==
MIME-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 7bit




<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 \
solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">  \
<tr>  <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/122584/">https://git.reviewboard.kde.org/r/122584/</a>
  </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On February 16th, 2015, 11:11 a.m. CET, <b>Inge \
Wallin</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">  <pre style="white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">Wouldn't a much better solution be to make the Private \
class of the KoMarker shared? If so, we could have the collection store KoMarkers \
instead of a collection of KoMarker*s. Making KoMarker itself a QSharedData feels \
very strange and is different than anything else in Calligra.</p></pre>  \
</blockquote>




 <p>On February 16th, 2015, 12:22 p.m. CET, <b>Sven Langkamp</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">That \
would not work. There is only one marker object in the marker collection and \
everything else just refers by pointers. Internal reference count would always be \
1.</p></pre>  </blockquote>





 <p>On February 16th, 2015, 2 p.m. CET, <b>Inge Wallin</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Yes, \
but then we wouldn't have to refer by pointer anymore. Actually using the objects \
themselves instead would be the way to do it. </p> <p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I \
still say it feels very strange to make this class alone a QSharedObject and no other \
object in Flake or libs/odf (which I think is where this class actually \
belongs).</p></pre>  </blockquote>





 <p>On February 16th, 2015, 2:36 p.m. CET, <b>Boudewijn Rempt</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">KoMarker doesn't belong in libs/odf, it's something that paints. Which also \
means that KoMarkerCollection doesn't beloing in libs/odf. And QSharedData is used in \
another places in flake: KoClipData.</p></pre>  </blockquote>








</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Ah, \
so <em style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: normal;">that's</em> the distinction between libs/odf and \
libs/flake. I never really saw the logical border between them.</p> <p \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">But did you actually look at KoClipData?  It's just the exposed internal \
implementation of KoClipPath (which also belongs in libs/odf, btw, since it doesn't \
paint). And it strengthens my point since I propose that we make the internal class \
the shared object.</p></pre> <br />










<p>- Inge</p>


<br />
<p>On February 16th, 2015, 2:26 a.m. CET, Sven Langkamp wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: \
1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; \
-webkit-border-radius: 6px;">  <tr>
  <td>

<div>Review request for Calligra.</div>
<div>By Sven Langkamp.</div>


<p style="color: grey;"><i>Updated Feb. 16, 2015, 2:26 a.m.</i></p>







<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="http://bugs.kde.org/show_bug.cgi?id=343719">343719</a>


</div>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
calligra
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">Use shared pointers for markers. Currently markers \
crash Krita on close (bug 343719). The problem is that existing path shapes point to \
the marker even after it's deleted. The patch solves that by using shared pointers \
for the marker.</p></pre>  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">Tested with Krita.</p></pre>  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>libs/flake/KoMarkerData.cpp <span style="color: grey">(247e151)</span></li>

 <li>libs/flake/KoMarker.h <span style="color: grey">(fa2adfd)</span></li>

 <li>libs/flake/KoMarkerCollection.h <span style="color: grey">(1555363)</span></li>

 <li>libs/flake/KoMarkerCollection.cpp <span style="color: \
grey">(98e80f8)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/122584/diff/" style="margin-left: \
3em;">View Diff</a></p>






  </td>
 </tr>
</table>







  </div>
 </body>
</html>


--===============6520060829125550445==--



_______________________________________________
calligra-devel mailing list
calligra-devel@kde.org
https://mail.kde.org/mailman/listinfo/calligra-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic