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

List:       kde-panel-devel
Subject:    Re: how to use the cache-to-disk feature in Wallpaper
From:       Benoit Jacob <jacob.benoit.1 () gmail ! com>
Date:       2009-04-12 15:15:08
Message-ID: d9f848520904120815u665eb4d0i1b5722bb136cfb75 () mail ! gmail ! com
[Download RAW message or body]

2009/4/10 Aaron J. Seigo <aseigo@kde.org>:
> papers (maybe i should add that bookkeeping into Wallpaper itself? Hmmmm..
> yes, probably... "let me get back to you on that one," he says, again.)

ok: caching is now implemented in Mandelbrot (r952792).

Here's again a somewhat lengthy email but you can skip to (***********).

I think i now have a clearer idea of what part of the bookkeeping
needs to be done in Plasma::Wallpaper and what can be done in
Mandelbrot.

The bookkeeping that Mandelbrot itself does is "whenever you insert a
new image into the cache, remove the previous image".

With this simple bookkeeping, stale cached images are inevitable when:
1) plasma crashes after caching the image and before saving the viewpoint.
2) the user is bored of mandelbrot and chooses another wallpaper
instead: then the cached images stay.

There is also a 3rd circumstance but for that one i've got an ugly workaround:
3) When we open Desktop Settings, the mini monitor may show a
different viewpoint than the previous time (if the user moved the view
in between). So the previous cached image stays.

The ugly workaround for 3) was to only cache images that have > 100000 pixels...

Anyway, here's a proposal:

(*******************)
Plasma::Wallpaper should remember for each cached image it's
"context": that is (i guess), which containment it belongs to. That
could be either stored in the filename, or by storing in different
sub-directories.

Periodically, Plasma should then erase all but the most recent image
for each containment, or at least offer an API to let the wallpaper do
so ("erase all my images except for this list of keys that should be
kept"). That also suggests that plasma should remember also which
wallpaper plugin an image belongs to -- currently i put "mandelbrot"
in the key but Plasma could do it for me.

Cheers,
Benoit
_______________________________________________
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