summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--imagecache.c10
-rw-r--r--imagecache.h4
-rw-r--r--nopacity.c11
-rw-r--r--nopacity.h1
-rw-r--r--setup.c3
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);
diff --git a/nopacity.c b/nopacity.c
index 073eb9b..cbe2841 100644
--- a/nopacity.c
+++ b/nopacity.c
@@ -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));
}
}
diff --git a/nopacity.h b/nopacity.h
index fc36af9..7652f7b 100644
--- a/nopacity.h
+++ b/nopacity.h
@@ -9,7 +9,6 @@ class cNopacityDisplayMenu;
class cNopacity : public cSkin {
private:
- bool init;
void ReloadCaches(void);
public:
cNopacity(void);
diff --git a/setup.c b/setup.c
index 01eb97f..d87088d 100644
--- a/setup.c
+++ b/setup.c
@@ -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));
}