class KPixmapCache |
|
|
General-purpose pixmap cache for KDE. It can be used e.g. by applications wanting to cache pixmaps rendered from SVGs. |
|
Constucts the pixmap cache object. name - unique name of the cache
|
|
Returns maximum size of the cache (in kilobytes). Default setting is 3 megabytes.
|
|
Deletes a pixmap cache. name - unique name of the cache to be deleted
|
|
Deletes all entries and reinitializes this cache.
|
|
|
Tries to load the specified pixmap from cache. Returns true when pixmap was found and loaded from cache, false otherwise
|
|
|
Insert specified pixmap into the cache.
|
|
Returns true when the cache is enabled. Cache will be disabled when e.g.it's data file cannot be created or read.
|
|
Returns true when the cache is ready to be used. False usually means that some additional initing has to be done before the cache can be used.
|
|
Can be used by subclasses to write custom data into the the stream.
|
|
Can be used by subclasses to write custom data into cache's header.
|
|
|
Loads pixmap from given file, using the cache. If file's modified-time is more recent than cache's timestamp() , then the cache is discarded.
|
|
Same as above, but uses SVG file instead. size - size of the pixmap where the SVG is render to. If not given then SVG's default size is used.
|
|
|
Removes some of the entries in the cache according to current removeEntryStrategy(). newsize - wanted size of the cache, in bytes. If 0 is given then current cacheLimit() is used. Warning: this works by copying some entries to a new cache and then replacing the old cache with the new one. Thus it might be slow and will temporarily use extra disk space.
|
|
Returns current entry removal strategy. Default is RemoveLeastRecentlyUsed.
|
|
Sets the maximum size of the cache (in kilobytes). If cache gets bigger the limit then some entries are removed (according to removeEntryStrategy() ). Setting cache limit to 0 disables automatic cache size limiting. Note that the cleanup might not be done immediately, so the cache might temporarily (for a few seconds) grow bigger than the limit.
|
|
Sets the removeEntryStrategy used when removing entries.
|
|
Sets the timestamp of app-specific cache. It's saved in the cache file and can later be retrieved using timestamp() method.
|
|
Sets whether QPixmapCache (memory caching) should be used in addition to disk cache. QPixmapCache is used by default
|
|
Can be used by subclasses to indicate that cache needs some additional initing before it can be used.
|
|
Returns approximate size of the cache, in kilobytes.
|
|
Returns timestamp of the cache, set using the setTimestamp method. It can be used by the application to check whether app-specific cache has outdated.
|
|
Whether QPixmapCache should be used to cache pixmaps in memory in addition to caching them on the disk.
|
|
Can be used by subclasses to load custom data from the the stream.
|
|
Can be used by subclasses to load custom data from cache's header.
|
|
|
RemoveOldest | - | ||
RemoveSeldomUsed | - | ||
RemoveLeastRecentlyUsed | - |