Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/room/delegate/pixmapcache.h
Show All 26 Lines | |||||
27 | #include <QPixmap> | 27 | #include <QPixmap> | ||
28 | 28 | | |||
29 | // QPixmapCache is too small for the big images in messages, let's have our own LRU cache | 29 | // QPixmapCache is too small for the big images in messages, let's have our own LRU cache | ||
30 | class LIBRUQOLAWIDGETS_TESTS_EXPORT PixmapCache | 30 | class LIBRUQOLAWIDGETS_TESTS_EXPORT PixmapCache | ||
31 | { | 31 | { | ||
32 | public: | 32 | public: | ||
33 | QPixmap pixmapForLocalFile(const QString &path); | 33 | QPixmap pixmapForLocalFile(const QString &path); | ||
34 | 34 | | |||
35 | QPixmap findCachedPixmap(const QString &path); | ||||
36 | void insertCachedPixmap(const QString &path, const QPixmap &pixmap); | ||||
37 | void clear(); | ||||
38 | | ||||
35 | private: | 39 | private: | ||
36 | friend class PixmapCacheTest; | 40 | friend class PixmapCacheTest; | ||
37 | LRUCache<QString, QPixmap, 5> mCachedImages; | 41 | LRUCache<QString, QPixmap, 5> mCachedImages; | ||
38 | QPixmap findCachedPixmap(const QString &link); | | |||
39 | void insertCachedPixmap(const QString &link, const QPixmap &pixmap); | | |||
40 | }; | 42 | }; | ||
41 | 43 | | |||
42 | #endif // PIXMAPCACHE_H | 44 | #endif // PIXMAPCACHE_H |