On Friday, May 31, 2013 12:12:11 Kai Uwe Broulik wrote:
> Am Freitag, 31. Mai 2013, 11:40:43 schrieb Aaron J. Seigo:
> > i imagine it would look sth like the attached patch (which builds, but i
> > haven't tested it yet)
> 
> Works!

yay! thanks for testing.

i have one reservation, and that is that KSharedDataCache can auto-discard 
entries. which means this version entry could get popped out 
undeterministically, resulting in an unecessary dropping of the cache.

the version number could be encoded into the filename of the cache. that would 
have the interesting effect of making the check completely automatic: change 
the version, change the cache.

that creates a new issue: stale caches left laying around. so if the cache is 
empty (at which point we can assume it is a new cache) or, alternatively, if 
the cache file does not exist, checking for other cache files for the same 
theme 
but different v# could be done.

accidental name collision should also be taken into consideration. currently 
the cache file name is "plasma_theme_" + themeName. with the v# in there it 
could be "plasma_theme_" + themeName + versionNumber .. but then a theme 
called "myTheme2" would collide with "myTheme" with version 2 ;) so there 
needs to be a divider of some sort to avoid that. perhaps "plasma_theme_" + 
themeName + "_v_" + versionNumber.

so .. yes, patch needs a bit more work.


on a similar but unrelated note: the wallpaper cache also grows indefinitely. 
we probably should introduce an age/use algorithm for dropping cached 
wallpapers.

-- 
Aaron J. Seigo

Attachment: signature.asc
Description: This is a digitally signed message part.

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

Reply via email to