<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://git.reviewboard.kde.org/r/118943/">https://git.reviewboard.kde.org/r/118943/</a>
</td>
</tr>
</table>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="https://git.reviewboard.kde.org/r/118943/diff/2/?file=284689#file284689line53" style="color: black; font-weight: bold; text-decoration: underline;">src/lib/marble/geodata/data/GeoDataAnimatedUpdate.cpp</a>
<span style="font-weight: normal;">
(Diff revision 2)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">GeoDataAnimatedUpdate &GeoDataAnimatedUpdate::operator=( const GeoDataAnimatedUpdate &other )</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">53</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="k">return</span> <span class="n">d</span><span class="o">-></span><span class="n">m_duration</span> <span class="o">==</span> <span class="n">other</span><span class="p">.</span><span class="n">d</span><span class="o">-></span><span class="n">m_duration</span> <span class="o">&&</span> <span class="n">d</span><span class="o">-></span><span class="n">m_update</span> <span class="o">==</span> <span class="n">other</span><span class="p">.</span><span class="n">d</span><span class="o">-></span><span class="n">m_update</span><span class="p">;</span></pre></td>
<th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">53</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="k">return</span> <span class="n">d</span><span class="o">-></span><span class="n">m_duration</span> <span class="o">==</span> <span class="n">other</span><span class="p">.</span><span class="n">d</span><span class="o">-></span><span class="n">m_duration</span> <span class="o">&&</span> <span class="o"><span class="hl">*</span></span><span class="p"><span class="hl">(</span></span><span class="n">d</span><span class="o">-></span><span class="n">m_update</span><span class="p"><span class="hl">)</span></span> <span class="o">==</span> <span class="o"><span class="hl">*</span></span><span class="p"><span class="hl">(</span></span><span class="n">other</span><span class="p">.</span><span class="n">d</span><span class="o">-></span><span class="n">m_update</span><span class="p"><span class="hl">)</span>;</span></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Must check for null pointers here. Alternatively, go back to using a non-pointer version of m_update.</pre>
</div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="https://git.reviewboard.kde.org/r/118943/diff/2/?file=284689#file284689line81" style="color: black; font-weight: bold; text-decoration: underline;">src/lib/marble/geodata/data/GeoDataAnimatedUpdate.cpp</a>
<span style="font-weight: normal;">
(Diff revision 2)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">GeoDataAnimatedUpdate::~GeoDataAnimatedUpdate()</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">81</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="kt">void</span> <span class="n">GeoDataAnimatedUpdate</span><span class="o">::</span><span class="n">setUpdate</span><span class="p">(</span> <span class="n">GeoDataUpdate</span> <span class="o"><span class="hl">&</span></span><span class="n">update</span> <span class="p">)</span></pre></td>
<th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">81</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="kt">void</span> <span class="n">GeoDataAnimatedUpdate</span><span class="o">::</span><span class="n">setUpdate</span><span class="p">(</span> <span class="n">GeoDataUpdate</span> <span class="o"><span class="hl">*</span></span><span class="n">update</span> <span class="p">)</span></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Let's delete the old update here (unless you switch back to using a non-pointer version). Also m_update should have its parent set in either case:
delete d->m_update;
d->m_update = update;
if ( d->m_update ) {
d->m_update->setParent( this );
}
</pre>
</div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="https://git.reviewboard.kde.org/r/118943/diff/2/?file=284693#file284693line49" style="color: black; font-weight: bold; text-decoration: underline;">src/lib/marble/geodata/data/GeoDataUpdate.cpp</a>
<span style="font-weight: normal;">
(Diff revision 2)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">GeoDataUpdate &GeoDataUpdate::operator=( const GeoDataUpdate &other )</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">49</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="k">if</span><span class="p">(</span> <span class="n">d</span><span class="o">-></span><span class="n">m_change</span> <span class="o">&&</span> <span class="n">other</span><span class="p">.</span><span class="n">d</span><span class="o">-></span><span class="n">m_change</span> <span class="p">){</span></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This is not enough. You must also cover the case where this has m_change set and the other a null pointer, and vice versa. Or use a non-pointer version.
</pre>
</div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="https://git.reviewboard.kde.org/r/118943/diff/2/?file=284693#file284693line87" style="color: black; font-weight: bold; text-decoration: underline;">src/lib/marble/geodata/data/GeoDataUpdate.cpp</a>
<span style="font-weight: normal;">
(Diff revision 2)
</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">87</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="n">d</span><span class="o">-></span><span class="n">m_change</span> <span class="o">=</span> <span class="n">change</span><span class="p">;</span></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Must set parent and, in case of a pointer version, delete the old m_change (see above).</pre>
</div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="https://git.reviewboard.kde.org/r/118943/diff/2/?file=284704#file284704line29" style="color: black; font-weight: bold; text-decoration: underline;">src/lib/marble/geodata/writers/kml/KmlAnimatedUpdateTagWriter.cpp</a>
<span style="font-weight: normal;">
(Diff revision 2)
</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">29</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="k">const</span> <span class="n">GeoDataAnimatedUpdate</span> <span class="o">*</span><span class="n">animUpdate</span> <span class="o">=</span> <span class="k">static_cast</span><span class="o"><</span><span class="k">const</span> <span class="n">GeoDataAnimatedUpdate</span><span class="o">*></span><span class="p">(</span> <span class="n">node</span> <span class="p">);</span></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">For safety better Q_ASSERT on the nodeType() before using a static_cast</pre>
</div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="https://git.reviewboard.kde.org/r/118943/diff/2/?file=284708#file284708line34" style="color: black; font-weight: bold; text-decoration: underline;">src/lib/marble/geodata/writers/kml/KmlUpdateTagWriter.cpp</a>
<span style="font-weight: normal;">
(Diff revision 2)
</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">32</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="k">if</span><span class="p">(</span> <span class="n">update</span><span class="o">-></span><span class="n">change</span><span class="p">()</span> <span class="p">){</span></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I'd also check that change()->size() > 0 to avoid ending up with an empty <Update/> tag</pre>
</div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="https://git.reviewboard.kde.org/r/118943/diff/2/?file=284710#file284710line87" style="color: black; font-weight: bold; text-decoration: underline;">tests/data/Tour.kml</a>
<span style="font-weight: normal;">
(Diff revision 2)
</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">12</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <altitude>41277.571403</altitude></pre></td>
<th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">87</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <altitude><span class="hl">0.0000000000</span></altitude></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Isn't that the default value which shouldn't be written?</pre>
</div>
<br />
<p>- Dennis Nienhüser</p>
<br />
<p>On June 26th, 2014, 6:36 a.m. UTC, Sanjiban Bairagya wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Marble, Dennis Nienhüser and Torsten Rahn.</div>
<div>By Sanjiban Bairagya.</div>
<p style="color: grey;"><i>Updated June 26, 2014, 6:36 a.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
marble
</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;">This patch allows to accept Placemarks as children of GeoDataChange</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;">Tested and passed with tests/Tour.kml</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>src/lib/marble/geodata/CMakeLists.txt <span style="color: grey">(bac40ac)</span></li>
<li>src/lib/marble/geodata/data/GeoDataAnimatedUpdate.h <span style="color: grey">(5794656)</span></li>
<li>src/lib/marble/geodata/data/GeoDataAnimatedUpdate.cpp <span style="color: grey">(511073c)</span></li>
<li>src/lib/marble/geodata/data/GeoDataChange.h <span style="color: grey">(PRE-CREATION)</span></li>
<li>src/lib/marble/geodata/data/GeoDataChange.cpp <span style="color: grey">(PRE-CREATION)</span></li>
<li>src/lib/marble/geodata/data/GeoDataUpdate.h <span style="color: grey">(ddadee2)</span></li>
<li>src/lib/marble/geodata/data/GeoDataUpdate.cpp <span style="color: grey">(ce42922)</span></li>
<li>src/lib/marble/geodata/handlers/kml/KmlAltitudeModeTagHandler.cpp <span style="color: grey">(9827969)</span></li>
<li>src/lib/marble/geodata/handlers/kml/KmlChangeTagHandler.h <span style="color: grey">(PRE-CREATION)</span></li>
<li>src/lib/marble/geodata/handlers/kml/KmlChangeTagHandler.cpp <span style="color: grey">(PRE-CREATION)</span></li>
<li>src/lib/marble/geodata/handlers/kml/KmlGxAltitudeModeTagHandler.cpp <span style="color: grey">(3a6bf5a)</span></li>
<li>src/lib/marble/geodata/handlers/kml/KmlModelTagHandler.cpp <span style="color: grey">(fe2f126)</span></li>
<li>src/lib/marble/geodata/handlers/kml/KmlPlacemarkTagHandler.cpp <span style="color: grey">(110bc40)</span></li>
<li>src/lib/marble/geodata/handlers/kml/KmlUpdateTagHandler.cpp <span style="color: grey">(534749c)</span></li>
<li>src/lib/marble/geodata/parser/GeoDataTypes.h <span style="color: grey">(dafcea3)</span></li>
<li>src/lib/marble/geodata/parser/GeoDataTypes.cpp <span style="color: grey">(e87b876)</span></li>
<li>src/lib/marble/geodata/writers/kml/KmlAnimatedUpdateTagWriter.h <span style="color: grey">(PRE-CREATION)</span></li>
<li>src/lib/marble/geodata/writers/kml/KmlAnimatedUpdateTagWriter.cpp <span style="color: grey">(PRE-CREATION)</span></li>
<li>src/lib/marble/geodata/writers/kml/KmlLookAtTagWriter.cpp <span style="color: grey">(4e45daa)</span></li>
<li>src/lib/marble/geodata/writers/kml/KmlPlaylistTagWriter.cpp <span style="color: grey">(86511bb)</span></li>
<li>src/lib/marble/geodata/writers/kml/KmlPointTagWriter.cpp <span style="color: grey">(70eadbc)</span></li>
<li>src/lib/marble/geodata/writers/kml/KmlUpdateTagWriter.cpp <span style="color: grey">(fc1ddf6)</span></li>
<li>tests/TestTour.cpp <span style="color: grey">(db2d9c9)</span></li>
<li>tests/data/Tour.kml <span style="color: grey">(d9fc9ed)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/118943/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>