diff options
author | louis <louis.braun@gmx.de> | 2015-07-07 17:58:10 +0200 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2015-07-07 17:58:10 +0200 |
commit | 5a6fb850b35bc63325cac482daaa70b00b0e8e8b (patch) | |
tree | c46bea143641a4a0f4461b971ae2cd03e10ac76b /libcore | |
parent | 50fe393724a265341b1745dd401db9d93f46f354 (diff) | |
download | vdr-plugin-skindesigner-5a6fb850b35bc63325cac482daaa70b00b0e8e8b.tar.gz vdr-plugin-skindesigner-5a6fb850b35bc63325cac482daaa70b00b0e8e8b.tar.bz2 |
immplemented areacontainers to group areas
Diffstat (limited to 'libcore')
-rw-r--r-- | libcore/helpers.c | 5 | ||||
-rw-r--r-- | libcore/skinsetup.c | 30 | ||||
-rw-r--r-- | libcore/skinsetup.h | 6 |
3 files changed, 22 insertions, 19 deletions
diff --git a/libcore/helpers.c b/libcore/helpers.c index bdddb66..6af7bcb 100644 --- a/libcore/helpers.c +++ b/libcore/helpers.c @@ -151,7 +151,10 @@ bool FirstFileInFolder(string &path, string &extension, string &fileName) { void CreateFolder(string &path) { cString command = cString::sprintf("mkdir -p %s", path.c_str()); - system(*command); + int ok = system(*command); + if (!ok) { + esyslog("skindesigner: error creating folder %s", path.c_str()); + } } // trim from start diff --git a/libcore/skinsetup.c b/libcore/skinsetup.c index f695935..e52ff41 100644 --- a/libcore/skinsetup.c +++ b/libcore/skinsetup.c @@ -88,19 +88,19 @@ void cSkinSetupMenu::InitIterators(void) { subMenuIt = subMenus.begin(); } -void cSkinSetupMenu::SetParameter(eSetupParameterType paramType, xmlChar *name, xmlChar* displayText, xmlChar *min, xmlChar *max, xmlChar *value) { +void cSkinSetupMenu::SetParameter(eSetupParameterType paramType, string name, string displayText, string min, string max, string value) { cSkinSetupParameter *param = new cSkinSetupParameter(); param->type = paramType; - param->name = (const char*)name; - param->displayText = (const char*)displayText; + param->name = name; + param->displayText = displayText; - if (min && paramType == sptInt) { - param->min = atoi((const char*)min); + if (min.size() && paramType == sptInt) { + param->min = atoi(min.c_str()); } - if (max && paramType == sptInt) { - param->max = atoi((const char*)max); + if (max.size() && paramType == sptInt) { + param->max = atoi(max.c_str()); } - param->value = atoi((const char*)value); + param->value = atoi(value.c_str()); parameters.push_back(param); } @@ -169,10 +169,10 @@ bool cSkinSetup::ReadFromXML(void) { return true; } -void cSkinSetup::SetSubMenu(xmlChar *name, xmlChar *displayText) { +void cSkinSetup::SetSubMenu(string name, string displayText) { cSkinSetupMenu *subMenu = new cSkinSetupMenu(); - subMenu->SetName((const char*)name); - subMenu->SetDisplayText((const char*)displayText); + subMenu->SetName(name); + subMenu->SetDisplayText(displayText); subMenu->SetParent(currentMenu); currentMenu->AddSubMenu(subMenu); currentMenu = subMenu; @@ -185,15 +185,15 @@ void cSkinSetup::SubMenuDone(void) { } } -void cSkinSetup::SetParameter(xmlChar *type, xmlChar *name, xmlChar* displayText, xmlChar *min, xmlChar *max, xmlChar *value) { - if (!type || !name || !displayText || !value) { +void cSkinSetup::SetParameter(string type, string name, string displayText, string min, string max, string value) { + if (!type.size() || !name.size() || !displayText.size() || !value.size()) { esyslog("skindesigner: invalid setup parameter for skin %s", skin.c_str()); return; } eSetupParameterType paramType = sptUnknown; - if (!xmlStrcmp(type, (const xmlChar *) "int")) { + if (!type.compare("int")) { paramType = sptInt; - } else if (!xmlStrcmp(type, (const xmlChar *) "bool")) { + } else if (!type.compare("bool")) { paramType = sptBool; } if (paramType == sptUnknown) { diff --git a/libcore/skinsetup.h b/libcore/skinsetup.h index 0de768b..29649ed 100644 --- a/libcore/skinsetup.h +++ b/libcore/skinsetup.h @@ -55,7 +55,7 @@ public: void SetParent(cSkinSetupMenu *p) { parent = p; }; cSkinSetupMenu *GetParent(void) { return parent; }; void AddSubMenu(cSkinSetupMenu *sub) { subMenus.push_back(sub); }; - void SetParameter(eSetupParameterType paramType, xmlChar *name, xmlChar* displayText, xmlChar *min, xmlChar *max, xmlChar *value); + void SetParameter(eSetupParameterType paramType, string name, string displayText, string min, string max, string value); void InitIterators(void); void InitParameterIterator(void) { paramIt = parameters.begin(); }; cSkinSetupParameter *GetNextParameter(bool deep = true); @@ -80,9 +80,9 @@ public: cSkinSetup(string skin); virtual ~cSkinSetup(void); bool ReadFromXML(void); - void SetSubMenu(xmlChar *name, xmlChar *displayText); + void SetSubMenu(string name, string displayText); void SubMenuDone(void); - void SetParameter(xmlChar *type, xmlChar *name, xmlChar* displayText, xmlChar *min, xmlChar *max, xmlChar *value); + void SetParameter(string type, string name, string displayText, string min, string max, string value); void InitParameterIterator(void) { rootMenu->InitIterators(); }; cSkinSetupParameter *GetNextParameter(void); cSkinSetupParameter *GetParameter(string name); |