summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/lib
Side-by-side diff
Diffstat (limited to 'noncore/graphics/opie-eye/lib') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/lib/imagecache.cpp6
-rw-r--r--noncore/graphics/opie-eye/lib/imagecache.h5
2 files changed, 11 insertions, 0 deletions
diff --git a/noncore/graphics/opie-eye/lib/imagecache.cpp b/noncore/graphics/opie-eye/lib/imagecache.cpp
index 3b74a83..f1042a4 100644
--- a/noncore/graphics/opie-eye/lib/imagecache.cpp
+++ b/noncore/graphics/opie-eye/lib/imagecache.cpp
@@ -62,6 +62,12 @@ PPixmapCache::PPixmapCache() {
PPixmapCache::~PPixmapCache() {
}
+void PPixmapCache::setMaxImages(unsigned int aMax)
+{
+ m_MaxImages = aMax;
+ setMaxCost( 64*64*QPixmap::defaultDepth()/8*m_MaxImages);
+}
+
PPixmapCache* PPixmapCache::self() {
if ( !_pxmCache )
_pxmCache = new PPixmapCache;
diff --git a/noncore/graphics/opie-eye/lib/imagecache.h b/noncore/graphics/opie-eye/lib/imagecache.h
index 076ecd3..939247a 100644
--- a/noncore/graphics/opie-eye/lib/imagecache.h
+++ b/noncore/graphics/opie-eye/lib/imagecache.h
@@ -28,11 +28,16 @@ class PPixmapCache : public QCache<QPixmap> {
private:
PPixmapCache();
~PPixmapCache();
+
+ unsigned int m_MaxImages;
+
public:
static PPixmapCache *self();
QPixmap* cachedImage( const QString& path, int width, int height );
void insertImage( const QString& path, const QPixmap &, int width, int height );
void insertImage( const QString& path, const QPixmap *, int width, int height );
+ void setMaxImages(unsigned int aMax);
+ unsigned int maxImages()const{return m_MaxImages;}
};
inline void PPixmapCache::insertImage( const QString& path, const QPixmap& p, int width, int height ) {