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










<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On July 17th, 2016, 10:04 p.m. UTC, <b>Mark Gaiser</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  


<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/128465/diff/3/?file=471898#file471898line1714" style="color: black; font-weight: bold; text-decoration: underline;">src/kiconloader.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 3)

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



 
 

 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">1692</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="kt"><span class="hl">bool</span></span><span class="hl"> </span><span class="n"><span class="hl">found</span></span> <span class="o">=</span> <span class="n">d</span><span class="o">-></span><span class="n">mAvailab<span class="hl">leIcons</span></span><span class="p"><span class="hl">.</span></span><span class="n"><span class="hl">contains</span></span><span class="p">(</span><span class="n">name</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">1712</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="k"><span class="hl">auto</span></span><span class="hl"> </span><span class="n"><span class="hl">it</span></span> <span class="o">=</span> <span class="n">d</span><span class="o">-></span><span class="n">m<span class="hl">Icon</span>Availab<span class="hl">ility</span></span><span class="p"><span class="hl">.</span></span><span class="n"><span class="hl">find</span></span><span class="p">(</span><span class="n">name</span><span class="p">);</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">1693</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="o">!</span><span class="n">found</span> <span class="o">&&</span> <span class="o">!</span><span class="n">iconPath</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">KIconLoader</span><span class="o">::</span><span class="n">Desktop</span><span class="p">,</span> <span class="n">KIconLoader</span><span class="o">::</span><span class="n">MatchBest</span><span class="p">).</span><span class="n">isEmpty</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">1713</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="k">const</span> <span class="k">auto</span> <span class="n">end</span> <span class="o">=</span> <span class="n">d</span><span class="o">-></span><span class="n">mIconAvailability</span><span class="p">.</span><span class="n">end</span><span class="p">();</span></pre></td>
  </tr>

 </tbody>

</table>

  <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;">.constFind()
.constEnd()</p></pre>
 </blockquote>





</blockquote>
<pre style="margin-left: 1em; 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;">Haha yes I wrote non-const find/end on purpose because of the erase(it) that you suggested in the previous two-hashes approach. But there's no erase anymore, so constFind/constEnd it is ;)</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Fixed and pushed, thanks to you both for the reviews.</p></pre>
<br />




<p>- David</p>


<br />
<p>On July 18th, 2016, 7:54 a.m. UTC, David Faure 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 KDE Frameworks, Christoph Feck, David Rosca, Michael Pyne, and Olivier Goffart.</div>
<div>By David Faure.</div>


<p style="color: grey;"><i>Updated July 18, 2016, 7:54 a.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kiconthemes
</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;">Summary:
The code said "unknown icons should be searched for anew each time
[so that installing new icons works]". However this leads to massive
performance issues when opening the file dialog in a dir with many
files for which there is no mimetype icon.
In my case, 293 callgrind.out.* files in one dir (it's ironic that
they would create a huge performance issue...).

To make both sides happy (installing new icons should still work, but
still unknown icons shouldn't lead to a full disk search every time
icon.isNull() or icon.pixmap() is called), let's re-resolve unknown
icons again only after 5 seconds.

Benchmark results for loading an unavailable icon :
before: 43 msecs per iteration    (1897 disk locations checked)
after: 0.013 msecs per iteration  (pixmap found in the on-disk cache)
And the file dialog no longer crawls to a halt in the dir with 293 callgrind files.

Test Plan:

Reviewers:

Subscribers:</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;">(described in commit log)</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>autotests/kiconengine_unittest.cpp <span style="color: grey">(105e86c1e7bc6170c626aa80d34cdb6422acca9c)</span></li>

 <li>src/kiconloader.cpp <span style="color: grey">(d885318c166f2a996b038218366317615886a14e)</span></li>

</ul>

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






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







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