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 | | ||||
35 | private: | 38 | private: | ||
36 | friend class PixmapCacheTest; | 39 | friend class PixmapCacheTest; | ||
37 | LRUCache<QString, QPixmap, 5> mCachedImages; | 40 | LRUCache<QString, QPixmap, 5> mCachedImages; | ||
38 | QPixmap findCachedPixmap(const QString &link); | | |||
39 | void insertCachedPixmap(const QString &link, const QPixmap &pixmap); | | |||
40 | }; | 41 | }; | ||
41 | 42 | | |||
42 | #endif // PIXMAPCACHE_H | 43 | #endif // PIXMAPCACHE_H |