Diffstat (limited to 'noncore/graphics/opie-eye/lib') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/lib/imagecache.cpp | 6 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/lib/imagecache.h | 5 |
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() { | |||
62 | PPixmapCache::~PPixmapCache() { | 62 | PPixmapCache::~PPixmapCache() { |
63 | } | 63 | } |
64 | 64 | ||
65 | void PPixmapCache::setMaxImages(unsigned int aMax) | ||
66 | { | ||
67 | m_MaxImages = aMax; | ||
68 | setMaxCost( 64*64*QPixmap::defaultDepth()/8*m_MaxImages); | ||
69 | } | ||
70 | |||
65 | PPixmapCache* PPixmapCache::self() { | 71 | PPixmapCache* PPixmapCache::self() { |
66 | if ( !_pxmCache ) | 72 | if ( !_pxmCache ) |
67 | _pxmCache = new PPixmapCache; | 73 | _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> { | |||
28 | private: | 28 | private: |
29 | PPixmapCache(); | 29 | PPixmapCache(); |
30 | ~PPixmapCache(); | 30 | ~PPixmapCache(); |
31 | |||
32 | unsigned int m_MaxImages; | ||
33 | |||
31 | public: | 34 | public: |
32 | static PPixmapCache *self(); | 35 | static PPixmapCache *self(); |
33 | QPixmap* cachedImage( const QString& path, int width, int height ); | 36 | QPixmap* cachedImage( const QString& path, int width, int height ); |
34 | void insertImage( const QString& path, const QPixmap &, int width, int height ); | 37 | void insertImage( const QString& path, const QPixmap &, int width, int height ); |
35 | void insertImage( const QString& path, const QPixmap *, int width, int height ); | 38 | void insertImage( const QString& path, const QPixmap *, int width, int height ); |
39 | void setMaxImages(unsigned int aMax); | ||
40 | unsigned int maxImages()const{return m_MaxImages;} | ||
36 | }; | 41 | }; |
37 | 42 | ||
38 | inline void PPixmapCache::insertImage( const QString& path, const QPixmap& p, int width, int height ) { | 43 | inline void PPixmapCache::insertImage( const QString& path, const QPixmap& p, int width, int height ) { |