how to use the cache-to-disk feature in Wallpaper
Aaron J. Seigo
aseigo at kde.org
Fri Apr 10 21:54:50 CEST 2009
On Friday 10 April 2009, Benoit Jacob wrote:
> I did setUsingDiskCache(true); in the constructor, and I emit
when you are ready to cache the image, you can now call:
insertIntoCache(const QString& key, const QImage &image);
and if you want to see if it exists and retrieve it call:
bool findInCache(const QString &key, QImage &image, unsigned int lastModified
= 0)
with the same key. so in your case, you may want to include things like the
the view point and zoom level in the key.
also, i'd suggest:
* deleting the old image so the user doesn't end up with a bajillion cached
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.)
* putting a delay on the caching in case the user is moving around and zooming
and what not.. you don't want to cause a bunch of disk caching to happen.
maybe wait for non-action for 3-5 minutes or so?
--
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA EE75 D6B7 2EB1 A7F1 DB43
KDE core developer sponsored by Qt Software
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20090410/9909177a/attachment.sig
More information about the Plasma-devel
mailing list