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

List:       kde-panel-devel
Subject:    Re: Review Request: Changes at the functionality of the delete button.
From:       "Aaron J. Seigo" <aseigo () kde ! org>
Date:       2011-06-20 10:01:19
Message-ID: 20110620100119.23833.28771 () 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/101535/#review4042
-----------------------------------------------------------



projectmanager/projectmanager.cpp
<http://git.reviewboard.kde.org/r/101535/#comment3304>

    this is buggy. if confirmRemoveFromDisk is called first and then later \
confirmRemoveFromList is called ... m_destroyFlag will still be true and the project will not \
just be removed from the list, but also disk!  
    instead, i recommend changing removeProcess to take a bool and change the name to something \
more accurate about the method's job, e.g.: removeProject(bool deleteFiles). then call it \
directly from both places, so in confirmRemoveFromList we'd get:  
    if (KMessageBox::warningContinueCancel(this, dialogText) == KMessageBox::Continue) {
        removeProject(false);
    }
    
    and in confirmRemoveFromDisk:
    
    if (KMessageBox::warningContinueCancel(this, dialogText) == KMessageBox::Continue) {
        removeProject(true);
    }
    


- Aaron J.


On June 10, 2011, 9 p.m., Giorgos Tsiapaliwkas wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/101535/
> -----------------------------------------------------------
> 
> (Updated June 10, 2011, 9 p.m.)
> 
> 
> Review request for Plasma.
> 
> 
> Summary
> -------
> 
> Hello,
> 
> after a discussion with Aaron Seigo at the #plasma we decided to add a new button at the \
> project manager which is named "Remove Project From List",which deletes the project only from \
> the list(not from disk).The delete button was renamed to "Remove Project From Disk".Also i \
> consider it properly to change the names of some function in order to be more relative with \
> the buttons names.As well i changed and the functionality of confirmdeletion() in order to \
> avoid using the same code twice. 
> 
> Diffs
> -----
> 
> projectmanager/projectmanager.h 2c5bff2 
> projectmanager/projectmanager.cpp c00fd27 
> 
> Diff: http://git.reviewboard.kde.org/r/101535/diff
> 
> 
> Testing
> -------
> 
> compiles and runs without regressions.
> tested by me.
> 
> 
> Thanks,
> 
> Giorgos
> 
> 


[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/101535/">http://git.reviewboard.kde.org/r/101535/</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/101535/diff/4/?file=24273#file24273line65" style="color: \
black; font-weight: bold; text-decoration: underline;">projectmanager/projectmanager.cpp</a>  \
<span style="font-weight: normal;">

     (Diff revision 4)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">void \
ProjectManager::confirmDeletion()</pre></td>  <td colspan="2"><pre style="font-size: 8pt; \
line-height: 140%; margin: 0; "></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="kt">void</span> <span \
class="n">ProjectManager</span><span class="o">::</span><span class="n">confirm<span \
class="hl">Deletion</span></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">65</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">ProjectManager</span><span class="o">::</span><span class="n">confirm<span \
class="hl">RemoveFromList</span></span><span class="p">()</span></pre></td>  </tr>

 </tbody>





 
 

 <tbody>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font \
size="2">62</font></th>  <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; \
line-height: 140%; margin: 0; "><span class="p">{</span></pre></td>  <th bgcolor="#f0f0f0" \
style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font \
size="2">66</font></th>  <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; \
line-height: 140%; margin: 0; "><span class="p">{</span></pre></td>  </tr>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font \
size="2">63</font></th>  <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; \
line-height: 140%; margin: 0; ">    <span class="c1">//</span><span class="cs">TODO</span><span \
class="c1">: might want to disallow deleting a currently active project, or handle \
it</span></pre></td>  <th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; \
border-right: 1px solid #C0C0C0;" align="right"><font size="2">67</font></th>  <td \
bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    \
<span class="c1">//</span><span class="cs">TODO</span><span class="c1">: might want to disallow \
deleting a currently active project, or handle it</span></pre></td>  </tr>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font \
size="2">64</font></th>  <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; \
line-height: 140%; margin: 0; ">    <span class="c1">//      gracefully \
somehow.</span></pre></td>  <th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; \
border-right: 1px solid #C0C0C0;" align="right"><font size="2">68</font></th>  <td \
bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    \
<span class="c1">//      gracefully somehow.</span></pre></td>  </tr>

 </tbody>


 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font \
size="2">65</font></th>  <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; \
line-height: 140%; margin: 0; ">    <span class="n">QString</span> <span \
class="n">dialogText</span> <span class="o">=</span> <span class="n">i18n</span><span \
class="p">(</span><span class="s">&quot;Are you sure you want to <span class="hl">delet</span>e \
the selected projects? This cannot be undone.&quot;</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">69</font></th>  <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">QString</span> <span \
class="n">dialogText</span> <span class="o">=</span> <span class="n">i18n</span><span \
class="p">(</span><span class="s">&quot;Are you sure you want to <span class="hl">remov</span>e \
the selected projects<span class="hl"> from the list</span>? This cannot be \
undone.&quot;</span><span class="p">);</span></pre></td>  </tr>

 </tbody>





 
 

 <tbody>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font \
size="2">66</font></th>  <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; \
line-height: 140%; margin: 0; ">    <span class="kt">int</span> <span class="n">code</span> \
<span class="o">=</span> <span class="n">KMessageBox</span><span class="o">::</span><span \
class="n">warningContinueCancel</span><span class="p">(</span><span class="k">this</span><span \
class="p">,</span> <span class="n">dialogText</span><span class="p">);</span></pre></td>  <th \
bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">70</font></th>  <td bgcolor="#ffffff" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="kt">int</span> <span \
class="n">code</span> <span class="o">=</span> <span class="n">KMessageBox</span><span \
class="o">::</span><span class="n">warningContinueCancel</span><span class="p">(</span><span \
class="k">this</span><span class="p">,</span> <span class="n">dialogText</span><span \
class="p">);</span></pre></td>  </tr>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font \
size="2">67</font></th>  <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; \
line-height: 140%; margin: 0; ">    <span class="k">if</span> <span class="p">(</span><span \
class="n">code</span> <span class="o">!=</span> <span class="n">KMessageBox</span><span \
class="o">::</span><span class="n">Continue</span><span class="p">)</span> <span \
class="k">return</span><span class="p">;</span></pre></td>  <th bgcolor="#f0f0f0" \
style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font \
size="2">71</font></th>  <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; \
line-height: 140%; margin: 0; ">    <span class="k">if</span> <span class="p">(</span><span \
class="n">code</span> <span class="o">!=</span> <span class="n">KMessageBox</span><span \
class="o">::</span><span class="n">Continue</span><span class="p">)</span> <span \
class="k">return</span><span class="p">;</span></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">72</font></th>  \
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">  \
<span class="n">removeProcess</span><span class="p">();</span></pre></td>  </tr>

  <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">73</font></th>  \
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; \
"><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 buggy. if \
confirmRemoveFromDisk is called first and then later confirmRemoveFromList is called ... \
m_destroyFlag will still be true and the project will not just be removed from the list, but \
also disk!

instead, i recommend changing removeProcess to take a bool and change the name to something \
more accurate about the method&#39;s job, e.g.: removeProject(bool deleteFiles). then call it \
directly from both places, so in confirmRemoveFromList we&#39;d get:

if (KMessageBox::warningContinueCancel(this, dialogText) == KMessageBox::Continue) {
    removeProject(false);
}

and in confirmRemoveFromDisk:

if (KMessageBox::warningContinueCancel(this, dialogText) == KMessageBox::Continue) {
    removeProject(true);
}
</pre>
</div>
<br />



<p>- Aaron J.</p>


<br />
<p>On June 10th, 2011, 9 p.m., Giorgos Tsiapaliwkas 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 Plasma.</div>
<div>By Giorgos Tsiapaliwkas.</div>


<p style="color: grey;"><i>Updated June 10, 2011, 9 p.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;">Hello,

after a discussion with Aaron Seigo at the #plasma we decided to add a new button at the \
project manager which is named &quot;Remove Project From List&quot;,which deletes the project \
only from the list(not from disk).The delete button was renamed to &quot;Remove Project From \
Disk&quot;.Also i consider it properly to change the names of some function in order to be more \
relative with the buttons names.As well i changed and the functionality of confirmdeletion() in \
order to avoid using the same code twice.</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;">compiles and runs \
without regressions. tested by me.</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>projectmanager/projectmanager.h <span style="color: grey">(2c5bff2)</span></li>

 <li>projectmanager/projectmanager.cpp <span style="color: grey">(c00fd27)</span></li>

</ul>

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




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








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



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


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

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