<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 />










<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On January 29th, 2014, 1:50 p.m. UTC, <b>Aaron J. Seigo</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/115326/diff/3/?file=240803#file240803line273" style="color: black; font-weight: bold; text-decoration: underline;">plasma/theme.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 3)

    </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 = "internal-system-colors";</pre></td>

  </tr>
 </tbody>



 
 

 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">248</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <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">270</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">            <span class="c1">// Repeat for SVG caches.</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">249</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">271</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">const</span> <span class="n">QString</span> <span class="o">&</span><span class="n">file</span><span class="p">,</span> <span class="n">KGlobal</span><span class="o">::</span><span class="n">dirs</span><span class="p">()</span><span class="o">-></span><span class="n">findAllResources</span><span class="p">(</span><span class="s">"cache"</span><span class="p">,</span> <span class="n">svgCacheFileBase</span><span class="p">))</span> <span class="p">{</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">250</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="n">ThemeConfig</span> <span class="n">config</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">272</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">currentSvgCacheFileName</span><span class="p">.</span><span class="n">isEmpty</span><span class="p">()</span> <span class="o">||</span> <span class="o">!</span><span class="n">file</span><span class="p">.</span><span class="n">endsWith</span><span class="p">(</span><span class="n">currentSvgCacheFileName</span><span class="p">))</span> <span class="p">{</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">251</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="n">pixmapCache</span> <span class="o">=</span> <span class="k">new</span> <span class="n">KImageCache</span><span class="p">(</span><span class="n">cacheFile</span><span class="p">,</span> <span class="n">config</span><span class="p">.</span><span class="n">themeCacheKb</span><span class="p">()</span> <span class="o">*</span> <span class="mi">1024</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">273</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                    <span class="n">QFile</span><span class="o">::</span><span class="n">remove</span><span class="p">(</span><span class="n">file</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;">it's nice to clean up the svg elements files; however without an active cache file it doesn't matter and they are a couple dozen K in size. didn't seem worth it for cache directory maintenance.

leaving them on disk would result them in them being used again if the user installs a newer version of the theme, then later rolls back to an older version. however, given that the svg file should be tied to the version of the theme, all this accomplishes is having to re-calculate all the svg geometry data.

i don't see the point in doing this at all.</pre>
 </blockquote>



 <p>On January 29th, 2014, 2:48 p.m. UTC, <b>Harald Sitter</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">well, from a downgrade POV perhaps the kimagecache cleanup also ought not delte all versions but those older than one or two versions down? that is, if downgrading is actually a viable use case of course. otherwise the logic would seem a bit incosistent. yeah, the kcache is sustantially larger, but I doubt any piece of software iterating the cache dir will care much for that reasoning when the dir suddenly contains

plasma-svgelements-yolo_v1
plasma-svgelements-yolo_v2
plasma-svgelements-yolo_v3
plasma-svgelements-yolo_v4
plasma-svgelements-yolo_v5
plasma-svgelements-yolo_v6
...

</pre>
 </blockquote>





 <p>On January 29th, 2014, 4:52 p.m. UTC, <b>Aaron J. Seigo</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">"from a downgrade POV perhaps the kimagecache cleanup also ought not delte all versions but those older than one or two versions down?"

besides requiring a version parser / standard that gets followed, this is overly complex. downgrading themes is not common, which is why the caches are removed.

"otherwise the logic would seem a bit incosistent."

i don't see how: it keeps the cache for the current version, drops the rest.

"yeah, the kcache is sustantially larger"

which is a significant issue on devices with smaller disks or many users.

"but I doubt any piece of software iterating the cache dir will care much for that reasoning when the dir suddenly contains"

it's not about iterating the dir, but using substantial amounts of disk space for no reason.</pre>
 </blockquote>





 <p>On January 30th, 2014, 8:53 a.m. UTC, <b>Harald Sitter</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">So, what do you want me to do, or not to do? I am not following sorry :/</pre>
 </blockquote>





 <p>On January 30th, 2014, 10:26 a.m. UTC, <b>Aaron J. Seigo</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The code ought to:

* version both cache files to reflect the version # of the theme
* drop all other image caches (new / old, doesn't matter -> whatever isn't being used should be removed; elements cache files could also be removed but aren't a significant issue as they are a few dozen kb)

Can you try the patch posted here: http://pastebin.kde.org/p6czlim0q
</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;">Okeydokey, new diff should cover everything then.</pre>
<br />




<p>- Harald</p>


<br />
<p>On January 30th, 2014, 10:56 a.m. UTC, 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. 30, 2014, 10:56 a.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;">- to decide whether or not to discard a cache type now the mtimes of metadata.desktop and the pixmap cache file (previously this was an invalid file compared to cache change time)
- the discard check now compares the mtime of the actual pixmap cache file and the actual metadata file to ensure that we are comparing values with equal meaning (previously the kimagecache modification time was used  which appears to be the creation time of the object by default)
- whether the cache needs to be discard is decided before kimagecache is created to avoid it altering the mtime, actual discarding still happens after initialization of the pixmap cache
- introduced a new themeVersion member on the private class
- svgelements cache is now using a versioned cache file whenever themeVersion is not empty
- introduce svgelements cache maintenance in useCache()
- pixmap cache is now using a versioned cache file whenever themeVersion is not empty (previously the wrong name var was used)
- various variables inside useCache had their names adjusted to clearify their purpose.
</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;">cache file lineup:
  cache/plasma-svgelements-default
  cache/plasma-svgelements-default_v1.9
  cache/plasma-svgelements-default_v2.0 (no pix cache)
  cache/plasma_theme_default.kcache
  cache/plasma_theme_default_v1.9.kcache
  cache/plasma_theme_default_v2.1.kcache (no svg cache)

version of default theme for testing: 2.2

[T1] initial run without v2.2 caches:
deleted all previous caches, correctly created plasma-svgelements-default_v2.2 and plasma_theme_default_v2.2.kcache.

[T2] subsequent run with v2.2 cache present:
deleted all prevoius caches, existing v2.2 cache not deleted or discard by useCache().

[T3] subsequent run with v2.2 cache present and `touch metadata.desktop`:
deleted all prevoius caches, existing v2.2 cache not deleted, but discarded by useCache().

[T4] subsequent run with v2.2. cache, but default theme has no version anymore:
deleted *all* caches, discarded (newly created) empty caches plasma-svgelements-default and plasma_theme_default.kcache.</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>