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

List:       kde-panel-devel
Subject:    Re: Review Request: Allow to choose between ascending and descending icon sort order in folderview
From:       "Marco Martin" <notmart () gmail ! com>
Date:       2012-02-03 18:45:04
Message-ID: 20120203184504.28986.15819 () 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/103860/#review10327
-----------------------------------------------------------


apart the small issue below, almost good to go


plasma/applets/folderview/folderview.cpp
<http://git.reviewboard.kde.org/r/103860/#comment8513>

    save in the config directly the enum values as integers



plasma/applets/folderview/folderview.cpp
<http://git.reviewboard.kde.org/r/103860/#comment8514>

    this shouldn't exist as well, only Qt::SortOrder should be passed around



plasma/applets/folderview/folderview.cpp
<http://git.reviewboard.kde.org/r/103860/#comment8515>

    config().writeEntry("sortOrder", m_sortOrder);


- Marco Martin


On Feb. 3, 2012, 6:29 p.m., Ignat Semenov wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/103860/
> -----------------------------------------------------------
> 
> (Updated Feb. 3, 2012, 6:29 p.m.)
> 
> 
> Review request for Plasma, Aaron J. Seigo and Marco Martin.
> 
> 
> Description
> -------
> 
> This patch allows to select between acsending and descending icon sort order in \
> folderview. 
> THe QVariant() and the short-circuit if's in cg.readEntry() / cg.writeEntry() stem \
> from the fact that Qt::SortOrder can not be converted to an int, and needs to be \
> operated this way. Thanks go to dfaure for explaining me how to do deal with the \
> enum problem. 
> 
> This addresses bug 180646.
> http://bugs.kde.org/show_bug.cgi?id=180646
> 
> 
> Diffs
> -----
> 
> plasma/applets/folderview/folderview.h e458d77 
> plasma/applets/folderview/folderview.cpp 54ea14a 
> 
> Diff: http://git.reviewboard.kde.org/r/103860/diff/diff
> 
> 
> Testing
> -------
> 
> Tested, works. Changes the icon sort direction, even though the actual sorting is \
> sometimes broken (my next task, most probably.) 
> 
> Thanks,
> 
> Ignat Semenov
> 
> 


[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/103860/">http://git.reviewboard.kde.org/r/103860/</a>
  </td>
    </tr>
   </table>
   <br />





 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">apart the small issue \
below, almost good to go</pre>  <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/103860/diff/1/?file=48661#file48661line366" \
style="color: black; font-weight: bold; text-decoration: \
underline;">plasma/applets/folderview/folderview.cpp</a>  <span style="font-weight: \
normal;">

     (Diff revision 1)

    </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 \
FolderView::init()</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">366</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span \
class="n">m_sortOrder</span>           <span class="o">=</span> <span \
class="p">(</span><span class="n">cg</span><span class="p">.</span><span \
class="n">readEntry</span><span class="p">(</span><span \
class="s">&quot;sortOrder&quot;</span><span class="p">,</span> <span \
class="s">&quot;asc&quot;</span><span class="p">)</span> <span class="o">==</span> \
<span class="s">&quot;asc&quot;</span> <span class="o">?</span> <span \
class="n">Qt</span><span class="o">::</span><span class="n">AscendingOrder</span> \
<span class="o">:</span> <span class="n">Qt</span><span class="o">::</span><span \
class="n">DescendingOrder</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;">save in the \
config directly the enum values as integers</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/103860/diff/1/?file=48661#file48661line511" \
style="color: black; font-weight: bold; text-decoration: \
underline;">plasma/applets/folderview/folderview.cpp</a>  <span style="font-weight: \
normal;">

     (Diff revision 1)

    </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 \
FolderView::configChanged()</pre></td>

  </tr>
 </tbody>



 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">508</font></th>  <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="k">if</span> \
<span class="p">(</span><span class="n">m_sortColumn</span> <span class="o">!=</span> \
<span class="n">sortColumn</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">511</font></th>  <td bgcolor="#fdfebc" width="50%"><pre style="font-size: \
8pt; line-height: 140%; margin: 0; ">    <span class="k">const</span> <span \
class="n">QString</span> <span class="n">stringSortOrder</span> <span \
class="o">=</span> <span class="p">(</span><span class="n">m_sortOrder</span> <span \
class="o">==</span> <span class="n">Qt</span><span class="o">::</span><span \
class="n">AscendingOrder</span> <span class="o">?</span> <span \
class="s">&quot;asc&quot;</span> <span class="o">:</span> <span \
class="s">&quot;desc&quot;</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 \
shouldn&#39;t exist as well, only Qt::SortOrder should be passed around</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/103860/diff/1/?file=48661#file48661line1792" \
style="color: black; font-weight: bold; text-decoration: \
underline;">plasma/applets/folderview/folderview.cpp</a>  <span style="font-weight: \
normal;">

     (Diff revision 1)

    </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; \
"></pre></td>  <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: \
0; ">void FolderView::sortingOrderChanged(QAction *action)</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">1792</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span \
class="n">config</span><span class="p">().</span><span \
class="n">writeEntry</span><span class="p">(</span><span \
class="s">&quot;sortOrder&quot;</span><span class="p">,</span> <span \
class="n">m_sortOrder</span> <span class="o">==</span> <span class="n">Qt</span><span \
class="o">::</span><span class="n">AscendingOrder</span> <span class="o">?</span> \
<span class="s">&quot;asc&quot;</span> <span class="o">:</span> <span \
class="s">&quot;desc&quot;</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;">config().writeEntry(&quot;sortOrder&quot;, m_sortOrder);</pre> </div>
<br />



<p>- Marco</p>


<br />
<p>On February 3rd, 2012, 6:29 p.m., Ignat Semenov 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, Aaron J. Seigo and Marco Martin.</div>
<div>By Ignat Semenov.</div>


<p style="color: grey;"><i>Updated Feb. 3, 2012, 6:29 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;">This patch allows to select between acsending and descending icon sort \
order in folderview.

THe QVariant() and the short-circuit if&#39;s in cg.readEntry() / cg.writeEntry() \
stem from the fact that Qt::SortOrder can not be converted to an int, and needs to be \
operated this way. Thanks go to dfaure for explaining me how to do deal with the enum \
problem.</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, works. Changes the icon sort direction, even though the actual \
sorting is sometimes broken (my next task, most probably.)</pre>  </td>
 </tr>
</table>



<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=180646">180646</a>


</div>


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

 <li>plasma/applets/folderview/folderview.h <span style="color: \
grey">(e458d77)</span></li>

 <li>plasma/applets/folderview/folderview.cpp <span style="color: \
grey">(54ea14a)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/103860/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