MythTV
master
|
#include <libmythui/mythuithemecache.h>
Public Member Functions | |
MythUIThemeCache () | |
~MythUIThemeCache () | |
void | UpdateImageCache () |
void | SetScreenSize (QSize Size) |
void | ClearThemeCacheDir () |
QString | GetThemeCacheDir () |
MythImage * | LoadCacheImage (QString File, const QString &Label, MythPainter *Painter, ImageCacheMode cacheMode=kCacheNormal) |
MythImage * | CacheImage (const QString &URL, MythImage *Image, bool NoDisk=false) |
void | RemoveFromCacheByFile (const QString &File) |
bool | IsImageInCache (const QString &URL) |
void | IncludeInCacheSize (MythImage *Image) |
void | ExcludeFromCacheSize (MythImage *Image) |
MThreadPool * | GetImageThreadPool () |
Private Member Functions | |
QString | GetCacheDirByUrl (const QString &URL) |
Look at the url being read and decide whether the cached version should go into the theme cache or the thumbnail cache. More... | |
void | RemoveFromCacheByURL (const QString &URL) |
MythImage * | GetImageFromCache (const QString &URL) |
void | ClearOldImageCache () |
void | RemoveCacheDir (const QString &Dir) |
Static Private Member Functions | |
static void | PruneCacheDir (const QString &Dir) |
Remove all files in the cache that haven't been accessed in a user configurable number of days. More... | |
Private Attributes | |
QMap< QString, MythImage * > | m_imageCache |
QMap< QString, SystemTime > | m_cacheTrack |
QRecursiveMutex | m_cacheLock |
QAtomicInteger< qint64 > | m_cacheSize { 0 } |
QAtomicInteger< qint64 > | m_maxCacheSize { 30LL * 1024 * 1024 } |
QString | m_themecachedir |
QSize | m_cacheScreenSize |
MThreadPool * | m_imageThreadPool { nullptr } |
Definition at line 22 of file mythuithemecache.h.
MythUIThemeCache::MythUIThemeCache | ( | ) |
Definition at line 25 of file mythuithemecache.cpp.
MythUIThemeCache::~MythUIThemeCache | ( | ) |
Definition at line 33 of file mythuithemecache.cpp.
void MythUIThemeCache::UpdateImageCache | ( | ) |
Definition at line 61 of file mythuithemecache.cpp.
Referenced by MythMainWindow::Init().
void MythUIThemeCache::SetScreenSize | ( | QSize | Size | ) |
Definition at line 51 of file mythuithemecache.cpp.
Referenced by MythUIScreenBounds::UpdateScreenSettings().
void MythUIThemeCache::ClearThemeCacheDir | ( | ) |
Definition at line 56 of file mythuithemecache.cpp.
Referenced by MythMainWindow::LoadQtConfig().
QString MythUIThemeCache::GetThemeCacheDir | ( | ) |
Definition at line 225 of file mythuithemecache.cpp.
Referenced by ClearOldImageCache(), GetCacheDirByUrl(), and RemoveFromCacheByFile().
MythImage * MythUIThemeCache::LoadCacheImage | ( | QString | File, |
const QString & | Label, | ||
MythPainter * | Painter, | ||
ImageCacheMode | cacheMode = kCacheNormal |
||
) |
Definition at line 257 of file mythuithemecache.cpp.
Referenced by MythUIImage::Load(), and ImageLoader::LoadImage().
MythImage * MythUIThemeCache::CacheImage | ( | const QString & | URL, |
MythImage * | Image, | ||
bool | NoDisk = false |
||
) |
Definition at line 413 of file mythuithemecache.cpp.
Referenced by LoadCacheImage(), and ImageLoader::LoadImage().
void MythUIThemeCache::RemoveFromCacheByFile | ( | const QString & | File | ) |
Definition at line 508 of file mythuithemecache.cpp.
Referenced by GalleryThumbView::customEvent(), EditAlbumartDialog::removeCachedImage(), GalleryThumbView::RemoveImages(), and MetadataImageDownload::run().
bool MythUIThemeCache::IsImageInCache | ( | const QString & | URL | ) |
Definition at line 548 of file mythuithemecache.cpp.
void MythUIThemeCache::IncludeInCacheSize | ( | MythImage * | Image | ) |
Definition at line 558 of file mythuithemecache.cpp.
Referenced by MythImage::DecrRef().
void MythUIThemeCache::ExcludeFromCacheSize | ( | MythImage * | Image | ) |
Definition at line 564 of file mythuithemecache.cpp.
Referenced by MythImage::IncrRef().
MThreadPool * MythUIThemeCache::GetImageThreadPool | ( | ) |
Definition at line 570 of file mythuithemecache.cpp.
Referenced by MythUIImage::Load(), and MythUIImage::~MythUIImage().
|
private |
Look at the url being read and decide whether the cached version should go into the theme cache or the thumbnail cache.
url | The resource being read. |
Definition at line 250 of file mythuithemecache.cpp.
Referenced by CacheImage(), LoadCacheImage(), and RemoveFromCacheByURL().
|
private |
Definition at line 490 of file mythuithemecache.cpp.
Referenced by LoadCacheImage(), and RemoveFromCacheByFile().
|
private |
Definition at line 390 of file mythuithemecache.cpp.
Referenced by LoadCacheImage().
|
private |
Definition at line 83 of file mythuithemecache.cpp.
Referenced by UpdateImageCache().
|
private |
Definition at line 124 of file mythuithemecache.cpp.
Referenced by ClearOldImageCache().
|
staticprivate |
Remove all files in the cache that haven't been accessed in a user configurable number of days.
The default number of days is seven.
dirname | The directory to prune. |
Definition at line 161 of file mythuithemecache.cpp.
Referenced by UpdateImageCache(), and ~MythUIThemeCache().
|
private |
Definition at line 49 of file mythuithemecache.h.
Referenced by CacheImage(), GetImageFromCache(), IsImageInCache(), LoadCacheImage(), RemoveFromCacheByFile(), RemoveFromCacheByURL(), UpdateImageCache(), and ~MythUIThemeCache().
|
private |
Definition at line 50 of file mythuithemecache.h.
Referenced by CacheImage(), GetImageFromCache(), LoadCacheImage(), RemoveFromCacheByURL(), UpdateImageCache(), and ~MythUIThemeCache().
|
private |
Definition at line 51 of file mythuithemecache.h.
Referenced by CacheImage(), GetImageFromCache(), IsImageInCache(), LoadCacheImage(), RemoveFromCacheByFile(), RemoveFromCacheByURL(), and UpdateImageCache().
|
private |
Definition at line 52 of file mythuithemecache.h.
Referenced by CacheImage(), ExcludeFromCacheSize(), IncludeInCacheSize(), and UpdateImageCache().
|
private |
Definition at line 53 of file mythuithemecache.h.
Referenced by CacheImage(), and MythUIThemeCache().
|
private |
Definition at line 54 of file mythuithemecache.h.
Referenced by ClearOldImageCache(), and ClearThemeCacheDir().
|
private |
Definition at line 55 of file mythuithemecache.h.
Referenced by GetThemeCacheDir(), and SetScreenSize().
|
private |
Definition at line 56 of file mythuithemecache.h.
Referenced by GetImageThreadPool(), and ~MythUIThemeCache().