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

List:       kde-edu-devel
Subject:    Re: Review Request: Fixing Krazy code checker issues
From:       "Kevin Krammer" <krammer () kde ! org>
Date:       2013-01-05 14:25:17
Message-ID: 20130105142517.24812.11342 () vidsolbach ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/108184/#review24739
-----------------------------------------------------------



kstars/fitsviewer/fitsviewer.cpp
<http://git.reviewboard.kde.org/r/108184/#comment19006>

    well, I guess from the that should have been const QString &filter



kstars/printing/pwizfovsh.cpp
<http://git.reviewboard.kde.org/r/108184/#comment19007>

    ah, no.
    The whole purpose of using QPointer is to be able to check for the dialog \
instance's validity.  this should be something like
    SkyObject *obj = findDlg ? findDlg->selectedObject() : 0;



kstars/printing/pwizfovsh.cpp
<http://git.reviewboard.kde.org/r/108184/#comment19008>

    this seems to be an intentation problem, d of delete should be aligned with d of \
detailDlg in the line before



kstars/printing/pwizobjectselection.cpp
<http://git.reviewboard.kde.org/r/108184/#comment19009>

    missing check for pointer validity, see above



kstars/tools/conjunctions.cpp
<http://git.reviewboard.kde.org/r/108184/#comment19010>

    missing pointer validity check.
    however, since geoPlace is not checked, I recommend adding it to the line before
    if ( ld->exec() == QDialog::Accepted && ld ) {



kstars/tools/conjunctions.cpp
<http://git.reviewboard.kde.org/r/108184/#comment19011>

    placement of ampersand
    const QString &object



kstars/tools/modcalcvlsr.cpp
<http://git.reviewboard.kde.org/r/108184/#comment19012>

    see above


- Kevin Krammer


On Jan. 5, 2013, 9:43 a.m., Mayank Madan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/108184/
> -----------------------------------------------------------
> 
> (Updated Jan. 5, 2013, 9:43 a.m.)
> 
> 
> Review request for KDE Edu and Kevin Krammer.
> 
> 
> Description
> -------
> 
> http://www.google-melange.com/gci/task/view/google/gci2012/8193206
> 
> 
> Diffs
> -----
> 
> kstars/ekos/guide/gmath.cpp bf629a2 
> kstars/ekos/guide/guider.cpp 30c6bcd 
> kstars/ekos/guide/rcalibration.cpp 3340ae4 
> kstars/ekos/guide/scroll_graph.cpp a37e81c 
> kstars/fitsviewer/fitsviewer.cpp d5c3fcb 
> kstars/printing/pwizfovsh.cpp b5a4101 
> kstars/printing/pwizobjectselection.cpp 50b9f5a 
> kstars/skyobjects/satellite.cpp 0ca44f7 
> kstars/tools/conjunctions.cpp 6b8c081 
> kstars/tools/modcalcvlsr.cpp 2a9b355 
> 
> Diff: http://git.reviewboard.kde.org/r/108184/diff/
> 
> 
> Testing
> -------
> 
> Yes, compiled and tested
> 
> 
> Thanks,
> 
> Mayank Madan
> 
> 


[Attachment #5 (text/html)]

<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="http://git.reviewboard.kde.org/r/108184/">http://git.reviewboard.kde.org/r/108184/</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="http://git.reviewboard.kde.org/r/108184/diff/2/?file=104939#file104939line158" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kstars/fitsviewer/fitsviewer.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; \
">FITSViewer::FITSViewer (QWidget *parent)</pre></td>

  </tr>
 </tbody>



 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">158</font></th>  <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span \
class="n">foreach</span><span class="p">(</span><span class="n">QString</span> <span \
class="n">filter</span><span class="p">,</span> <span \
class="n">FITSViewer</span><span class="o">::</span><span \
class="n">filterTypes</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">158</font></th>  <td bgcolor="#fdfebc" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span \
class="n">foreach</span><span class="p">(</span><span class="k"><span \
class="hl">const</span></span><span class="hl"> </span><span \
class="n">QString</span><span class="o"><span class="hl">&amp;</span></span> <span \
class="n">filter</span><span class="p">,</span> <span \
class="n">FITSViewer</span><span class="o">::</span><span \
class="n">filterTypes</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;">well, I \
guess from the that should have been const QString &amp;filter</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="http://git.reviewboard.kde.org/r/108184/diff/2/?file=104940#file104940line48" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kstars/printing/pwizfovsh.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; ">void \
PWizFovShUI::setBeginObject(SkyObject *obj)</pre></td>

  </tr>
 </tbody>



 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">48</font></th>  <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span \
class="n">SkyObject</span> <span class="o">*</span><span class="n">obj</span> <span \
class="o">=</span> <span class="n">findDlg</span><span class="p"><span \
class="hl">.</span></span><span class="n">selectedObject</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">48</font></th>  <td bgcolor="#fdfebc" width="50%"><pre style="font-size: \
8pt; line-height: 140%; margin: 0; ">        <span class="n">SkyObject</span> <span \
class="o">*</span><span class="n">obj</span> <span class="o">=</span> <span \
class="n">findDlg</span><span class="o"><span class="hl">-&gt;</span></span><span \
class="n">selectedObject</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;">ah, no. The \
whole purpose of using QPointer is to be able to check for the dialog instance&#39;s \
validity. this should be something like
SkyObject *obj = findDlg ? findDlg-&gt;selectedObject() : 0;</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="http://git.reviewboard.kde.org/r/108184/diff/2/?file=104940#file104940line69" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kstars/printing/pwizfovsh.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; ">void \
PWizFovShUI::setBeginObject(SkyObject *obj)</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">69</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="tb">	</span><span class="k">delete</span> <span \
class="n">detailDlg</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 seems \
to be an intentation problem, d of delete should be aligned with d of detailDlg in \
the line before</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="http://git.reviewboard.kde.org/r/108184/diff/2/?file=104941#file104941line61" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kstars/printing/pwizobjectselection.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; ">void \
PWizObjectSelectionUI::setSkyObject(SkyObject *obj)</pre></td>

  </tr>
 </tbody>



 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">61</font></th>  <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span \
class="n">SkyObject</span> <span class="o">*</span><span class="n">obj</span> <span \
class="o">=</span> <span class="n">findDlg</span><span class="p"><span \
class="hl">.</span></span><span class="n">selectedObject</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">61</font></th>  <td bgcolor="#fdfebc" width="50%"><pre style="font-size: \
8pt; line-height: 140%; margin: 0; ">        <span class="n">SkyObject</span> <span \
class="o">*</span><span class="n">obj</span> <span class="o">=</span> <span \
class="n">findDlg</span><span class="o"><span class="hl">-&gt;</span></span><span \
class="n">selectedObject</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;">missing \
check for pointer validity, 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="http://git.reviewboard.kde.org/r/108184/diff/2/?file=104943#file104943line173" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kstars/tools/conjunctions.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; ">void \
ConjunctionsTool::slotFindObject() {</pre></td>

  </tr>
 </tbody>



 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">173</font></th>  <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span \
class="n">geoPlace</span> <span class="o">=</span> <span class="n">ld</span><span \
class="p"><span class="hl">.</span></span><span class="n">selectedCity</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">173</font></th>  <td bgcolor="#fdfebc" width="50%"><pre style="font-size: \
8pt; line-height: 140%; margin: 0; ">        <span class="n">geoPlace</span> <span \
class="o">=</span> <span class="n">ld</span><span class="o"><span \
class="hl">-&gt;</span></span><span class="n">selectedCity</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;">missing \
pointer validity check. however, since geoPlace is not checked, I recommend adding it \
to the line before if ( ld-&gt;exec() == QDialog::Accepted &amp;&amp; ld ) {</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="http://git.reviewboard.kde.org/r/108184/diff/2/?file=104943#file104943line334" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kstars/tools/conjunctions.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; ">void \
ConjunctionsTool::slotCompute (void)</pre></td>

  </tr>
 </tbody>



 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">333</font></th>  <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span \
class="n">foreach</span><span class="p">(</span> <span class="n">QString</span> <span \
class="n">object</span><span class="p">,</span> <span class="n">objects</span> <span \
class="p">)</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">334</font></th>  <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span \
class="n">foreach</span><span class="p">(</span> <span class="k"><span \
class="hl">const</span></span><span class="hl"> </span><span \
class="n">QString</span><span class="o"><span class="hl">&amp;</span></span> <span \
class="n">object</span><span class="p">,</span> <span class="n">objects</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;">placement \
of ampersand const QString &amp;object</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="http://git.reviewboard.kde.org/r/108184/diff/2/?file=104944#file104944line96" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kstars/tools/modcalcvlsr.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; ">void \
modCalcVlsr::slotFindObject() {</pre></td>

  </tr>
 </tbody>



 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">96</font></th>  <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span \
class="n">GeoLocation</span> <span class="o">*</span><span class="n">newGeo</span> \
<span class="o">=</span> <span class="n">ld</span><span class="p"><span \
class="hl">.</span></span><span class="n">selectedCity</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">96</font></th>  <td bgcolor="#fdfebc" width="50%"><pre style="font-size: \
8pt; line-height: 140%; margin: 0; ">        <span class="n">GeoLocation</span> <span \
class="o">*</span><span class="n">newGeo</span> <span class="o">=</span> <span \
class="n">ld</span><span class="o"><span class="hl">-&gt;</span></span><span \
class="n">selectedCity</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;">see \
above</pre> </div>
<br />



<p>- Kevin</p>


<br />
<p>On January 5th, 2013, 9:43 a.m., Mayank Madan wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for KDE Edu and Kevin Krammer.</div>
<div>By Mayank Madan.</div>


<p style="color: grey;"><i>Updated Jan. 5, 2013, 9:43 a.m.</i></p>






<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;">http://www.google-melange.com/gci/task/view/google/gci2012/8193206</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;">Yes, compiled and tested</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>kstars/ekos/guide/gmath.cpp <span style="color: grey">(bf629a2)</span></li>

 <li>kstars/ekos/guide/guider.cpp <span style="color: grey">(30c6bcd)</span></li>

 <li>kstars/ekos/guide/rcalibration.cpp <span style="color: \
grey">(3340ae4)</span></li>

 <li>kstars/ekos/guide/scroll_graph.cpp <span style="color: \
grey">(a37e81c)</span></li>

 <li>kstars/fitsviewer/fitsviewer.cpp <span style="color: grey">(d5c3fcb)</span></li>

 <li>kstars/printing/pwizfovsh.cpp <span style="color: grey">(b5a4101)</span></li>

 <li>kstars/printing/pwizobjectselection.cpp <span style="color: \
grey">(50b9f5a)</span></li>

 <li>kstars/skyobjects/satellite.cpp <span style="color: grey">(0ca44f7)</span></li>

 <li>kstars/tools/conjunctions.cpp <span style="color: grey">(6b8c081)</span></li>

 <li>kstars/tools/modcalcvlsr.cpp <span style="color: grey">(2a9b355)</span></li>

</ul>

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




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








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



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


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

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