diff --git a/config.c b/config.c index 497e849..0f58331 100644 --- a/config.c +++ b/config.c @@ -31,6 +31,9 @@ cDesignerConfig::cDesignerConfig() { cDesignerConfig::~cDesignerConfig() { ClearSkinSetups(); + for (vector::iterator it = themes.begin(); it != themes.end(); it++) { + delete *it; + } } void cDesignerConfig::SetPathes(void) { @@ -81,6 +84,10 @@ bool cDesignerConfig::GetThemeColor(string &name, tColor &col) { return tmplGlobals->GetColor(name, col); } +void cDesignerConfig::StoreTheme(cTheme *theme) { + themes.push_back(theme); +} + void cDesignerConfig::ReadSkinFolder(cString &skinFolder, vector *container) { DIR *folder = NULL; struct dirent *dirEntry; @@ -171,7 +178,9 @@ cString cDesignerConfig::GetSkinPath(string skin) { } void cDesignerConfig::AddNewSkinRef(string skin) { - cSkinDesigner *newSkin = new cSkinDesigner(skin); + cTheme *theme = new cTheme(); + StoreTheme(theme); + cSkinDesigner *newSkin = new cSkinDesigner(skin, theme); AddSkin(newSkin); skins.push_back(skin); installerSkins.push_back(skin); diff --git a/config.h b/config.h index 0960b9b..3300a84 100644 --- a/config.h +++ b/config.h @@ -35,6 +35,7 @@ private: string osdLanguage; cGlobals *tmplGlobals; vector skinRefs; + vector themes; vector::iterator skinRefsIterator; vector deliveredSkins; vector installerSkins; @@ -56,6 +57,7 @@ public: void SetLogoPath(cString path); void SetEpgImagePath(cString path); bool GetThemeColor(string &name, tColor &col); + void StoreTheme(cTheme *theme); void ReadSkins(void); void ReadSkinSetup(string skin); void InitSkinIterator(void) { skinIterator = skins.begin(); }; @@ -121,14 +123,12 @@ public: cSDPluginManager *plgManager = NULL; cFontManager *fontManager = NULL; cImageCache *imgCache = NULL; - cTheme Theme; cRecordingsFolderInfo recFolderInfo(Recordings); #else extern cDesignerConfig config; extern cSDPluginManager *plgManager; extern cFontManager *fontManager; extern cImageCache *imgCache; - extern cTheme Theme; extern cRecordingsFolderInfo recFolderInfo; #endif diff --git a/designer.c b/designer.c index b3b5052..b6f35b1 100644 --- a/designer.c +++ b/designer.c @@ -1,7 +1,7 @@ #include "designer.h" #include "extensions/helpers.h" -cSkinDesigner::cSkinDesigner(string skin) : cSkin(skin.c_str(), &::Theme) { +cSkinDesigner::cSkinDesigner(string skin, cTheme *theme) : cSkin(skin.c_str(), theme) { init = true; this->skin = skin; diff --git a/designer.h b/designer.h index 18c94d2..8870392 100644 --- a/designer.h +++ b/designer.h @@ -41,7 +41,7 @@ private: void LoadPluginViews(void); void CacheViews(void); public: - cSkinDesigner(string skin); + cSkinDesigner(string skin, cTheme *theme); virtual ~cSkinDesigner(void); virtual const char *Description(void); virtual cSkinDisplayChannel *DisplayChannel(bool WithInfo); diff --git a/skindesigner.c b/skindesigner.c index 722de6c..a2138b3 100644 --- a/skindesigner.c +++ b/skindesigner.c @@ -140,7 +140,9 @@ bool cPluginSkinDesigner::Start(void) { bool skinAvailable = false; while (config.GetSkin(skin)) { config.ReadSkinSetup(skin); - cSkinDesigner *newSkin = new cSkinDesigner(skin); + cTheme *theme = new cTheme(); + config.StoreTheme(theme); + cSkinDesigner *newSkin = new cSkinDesigner(skin, theme); config.AddSkin(newSkin); skinAvailable = true; if (!trueColorAvailable) {