diff options
-rw-r--r-- | imagecache.c | 10 | ||||
-rw-r--r-- | imagecache.h | 4 | ||||
-rw-r--r-- | nopacity.c | 11 | ||||
-rw-r--r-- | nopacity.h | 1 | ||||
-rw-r--r-- | setup.c | 3 |
5 files changed, 7 insertions, 22 deletions
diff --git a/imagecache.c b/imagecache.c index dc9968d..dedc038 100644 --- a/imagecache.c +++ b/imagecache.c @@ -12,6 +12,7 @@ cImageCache *imgCache; cImageCache::cImageCache() : cImageMagickWrapper() { tempStaticLogo = NULL; osdTheme = Setup.OSDTheme; + CreateCache(); } cImageCache::~cImageCache() { @@ -60,9 +61,6 @@ void cImageCache::CreateCache(void) { } } -} - -void cImageCache::CreateCacheDelayed(void) { if (config.GetValue("displayType") == dtBlending) CreateSkinElementsBlended(); else if (config.GetValue("displayType") == dtGraphical) @@ -77,12 +75,6 @@ bool cImageCache::ThemeChanged(void) { return false; } -void cImageCache::Reload(void) { - Clear(); - CreateCache(); - CreateCacheDelayed(); -} - cImage *cImageCache::GetMenuIcon(std::string name) { std::map<std::string, cImage*>::iterator hit = menuIconCache.find(name); if (hit != menuIconCache.end()) { diff --git a/imagecache.h b/imagecache.h index a46b63d..cbecffe 100644 --- a/imagecache.h +++ b/imagecache.h @@ -74,9 +74,6 @@ class cImageCache : public cImageMagickWrapper { public: cImageCache(); ~cImageCache(); - void CreateCache(void); - void CreateCacheDelayed(void); - void Reload(void); bool ThemeChanged(void); cImage *GetMenuIcon(std::string name); cImage *GetSkinIcon(std::string name, int width=0, int height=0, bool preserveAspect = true); @@ -95,6 +92,7 @@ private: std::map<std::string, cImage*> logoTimerCache; std::vector<std::pair<std::string, cPoint> > GetMenuIcons(void); std::vector<std::pair<std::string, sImgProperties> > GetSkinIcons(void); + void CreateCache(void); bool LoadIcon(eCacheType type, std::string name); void InsertIntoIconCache(eCacheType type, std::string name, int width, int height, bool preserveAspect = true); bool LoadLogo(const cChannel *channel); @@ -12,7 +12,6 @@ #include "displaymessage.h" cNopacity::cNopacity(void) : cSkin("nOpacity", &::Theme) { - init = true; config.LoadThemeSpecificConfigs(); config.SetThemeSpecificDefaults(); config.SetThemeSetup(); @@ -21,8 +20,7 @@ cNopacity::cNopacity(void) : cSkin("nOpacity", &::Theme) { geoManager = new cGeometryManager(); geoManager->SetGeometry(); fontManager = NULL; - imgCache = new cImageCache(); - imgCache->CreateCache(); + imgCache = NULL; } cNopacity::~cNopacity() { @@ -37,10 +35,6 @@ const char *cNopacity::Description(void) { cSkinDisplayChannel *cNopacity::DisplayChannel(bool WithInfo) { ReloadCaches(); - if (init) { - imgCache->CreateCacheDelayed(); - init = false; - } return new cNopacityDisplayChannel(WithInfo); } @@ -79,7 +73,8 @@ void cNopacity::ReloadCaches(void) { geoManager->SetGeometry(); delete fontManager; fontManager = new cFontManager(); - imgCache->Reload(); + delete imgCache; + imgCache = new cImageCache(); dsyslog("nopacity: Cache reloaded in %d ms", int(cTimeMs::Now()-start)); } } @@ -9,7 +9,6 @@ class cNopacityDisplayMenu; class cNopacity : public cSkin { private: - bool init; void ReloadCaches(void); public: cNopacity(void); @@ -13,7 +13,8 @@ cNopacitySetup::~cNopacitySetup() { geoManager->SetGeometry(); delete fontManager; fontManager = new cFontManager(); - imgCache->Reload(); + delete imgCache; + imgCache = new cImageCache(); dsyslog("nopacity: Cache reloaded in %d ms", int(cTimeMs::Now()-start)); } |