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

List:       kde-panel-devel
Subject:    Re: Review Request 115326: fix theme cache cleanup and discarding
From:       "Martin Klapetek" <martin.klapetek () gmail ! com>
Date:       2014-01-27 16:30:55
Message-ID: 20140127163055.17577.39933 () probe ! kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/115326/#review48389
-----------------------------------------------------------

Ship it!


Seems good to me


plasma/theme.cpp
<https://git.reviewboard.kde.org/r/115326/#comment34217>

    Make both QLatin1String (or both plain strings)



plasma/theme.cpp
<https://git.reviewboard.kde.org/r/115326/#comment34218>

    Nuoooo



plasma/theme.cpp
<https://git.reviewboard.kde.org/r/115326/#comment34219>

    Seems like these two could be squashed into one but...meh, up to you



plasma/theme.cpp
<https://git.reviewboard.kde.org/r/115326/#comment34220>

    One thing I don't understand (not related to your changes though) - why does this \
return cacheTheme which never ever changes inside this method? And it also never \
returns anywhere else, so why is it even returning a boolean value when its value is \
already known before this method? :O


- Martin Klapetek


On Jan. 27, 2014, 12:30 p.m., Harald Sitter wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/115326/
> -----------------------------------------------------------
> 
> (Updated Jan. 27, 2014, 12:30 p.m.)
> 
> 
> Review request for Plasma, Aaron J. Seigo and Martin Klapetek.
> 
> 
> Repository: kdelibs
> 
> 
> Description
> -------
> 
> - introduce svgelements cache handling in useCache()
> - to decide whether or not to discard a cache type now the mtimes of \
> metadata.desktop and the respective cache file are compared (previously this was an \
>                 invalid file compared to cache change time)
> - cache cleanup now happens entirely before creation of the KImageCache instance to \
> prevent any sort of problem there 
> - add fixme comment about broken version-based cache handling. for one the version \
> specific file name is not actually used for the KImageCache and for another the \
> entire shebang is missing from svgelements all together. this has the very \
> unfortunate side effect that the *active* cache files are deleted ever so often, it \
> may be worth removing the code portions until someone finds time/interest to \
> actually implement this in a working fashion. 
> 
> Diffs
> -----
> 
> plasma/theme.cpp cb44878 
> 
> Diff: https://git.reviewboard.kde.org/r/115326/diff/
> 
> 
> Testing
> -------
> 
> upgraded from 4.8 straight to 4.12 -> theme caches correctly discarded
> 
> 
> Thanks,
> 
> Harald Sitter
> 
> 


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



 <p>Ship it!</p>



 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Seems good to me</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="https://git.reviewboard.kde.org/r/115326/diff/2/?file=240703#file240703line227" \
style="color: black; font-weight: bold; text-decoration: \
underline;">plasma/theme.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; ">const \
char *ThemePrivate::systemColorsTheme = \
&quot;internal-system-colors&quot;;</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">226</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">QString</span> <span \
class="n">pixmapCacheFileName</span> <span class="o">=</span> <span \
class="s">&quot;plasma_theme_&quot;</span> <span class="o">+</span> <span \
class="n">themeName</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">227</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">QString</span> <span \
class="n">svgCacheFileName</span> <span class="o">=</span> <span \
class="n">QLatin1String</span><span class="p">(</span><span \
class="s">&quot;plasma-svgelements-&quot;</span><span class="p">)</span> <span \
class="o">+</span> <span class="n">themeName</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;">Make both \
QLatin1String (or both plain strings)</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/115326/diff/2/?file=240703#file240703line257" \
style="color: black; font-weight: bold; text-decoration: \
underline;">plasma/theme.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; ">const \
char *ThemePrivate::systemColorsTheme = \
&quot;internal-system-colors&quot;;</pre></td>

  </tr>
 </tbody>



 
 

 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">236</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">KPluginInfo</span> <span \
class="n">pluginInfo</span><span class="p">(</span><span class="n">path</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">255</font></th>  <td bgcolor="#fdfebc" width="50%"><pre style="font-size: \
8pt; line-height: 140%; margin: 0; ">            <span class="n">qDebug</span><span \
class="p">()</span> <span class="o">&lt;&lt;</span> <span \
class="n">metaDataPath</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;">Nuoooo</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/115326/diff/2/?file=240703#file240703line298" \
style="color: black; font-weight: bold; text-decoration: \
underline;">plasma/theme.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; ">const \
char *ThemePrivate::systemColorsTheme = \
&quot;internal-system-colors&quot;;</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">293</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">QString</span> <span \
class="n">svgCacheFilePath</span> <span class="o">=</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">294</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">              \
<span class="n">KStandardDirs</span><span class="o">::</span><span \
class="n">locate</span><span class="p">(</span><span \
class="s">&quot;cache&quot;</span><span class="p">,</span> <span \
class="n">svgCacheFileName</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">295</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">QFileInfo</span> <span \
class="nf">svgCacheFileInfo</span><span class="p">(</span><span \
class="n">svgCacheFilePath</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;">Seems like \
these two could be squashed into one but...meh, up to you</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/115326/diff/2/?file=240703#file240703line311" \
style="color: black; font-weight: bold; text-decoration: \
underline;">plasma/theme.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; ">const \
char *ThemePrivate::systemColorsTheme = \
&quot;internal-system-colors&quot;;</pre></td>

  </tr>
 </tbody>



 
 

 <tbody>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">268</font></th>  <td bgcolor="#ffffff" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span \
class="k">return</span> <span class="n">cacheTheme</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">306</font></th>  <td bgcolor="#ffffff" width="50%"><pre style="font-size: \
8pt; line-height: 140%; margin: 0; ">    <span class="k">return</span> <span \
class="n">cacheTheme</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;">One thing I \
don&#39;t understand (not related to your changes though) - why does this return \
cacheTheme which never ever changes inside this method? And it also never returns \
anywhere else, so why is it even returning a boolean value when its value is already \
known before this method? :O</pre> </div>
<br />



<p>- Martin Klapetek</p>


<br />
<p>On January 27th, 2014, 12:30 p.m. CET, Harald Sitter 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 Plasma, Aaron J. Seigo and Martin Klapetek.</div>
<div>By Harald Sitter.</div>


<p style="color: grey;"><i>Updated Jan. 27, 2014, 12:30 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kdelibs
</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;">- introduce svgelements cache handling in useCache()
- to decide whether or not to discard a cache type now the mtimes of metadata.desktop \
and the respective cache file are compared (previously this was an invalid file \
                compared to cache change time)
- cache cleanup now happens entirely before creation of the KImageCache instance to \
prevent any sort of problem there

- add fixme comment about broken version-based cache handling. for one the version \
specific file name is not actually used for the KImageCache and for another the \
entire shebang is missing from svgelements all together. this has the very \
unfortunate side effect that the *active* cache files are deleted ever so often, it \
may be worth removing the code portions until someone finds time/interest to actually \
implement this in a working fashion.</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;">upgraded from 4.8 straight to 4.12 -&gt; theme caches correctly \
discarded</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>plasma/theme.cpp <span style="color: grey">(cb44878)</span></li>

</ul>

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