diff options
| author | louis <louis.braun@gmx.de> | 2015-01-19 10:50:22 +0100 |
|---|---|---|
| committer | louis <louis.braun@gmx.de> | 2015-01-19 10:50:22 +0100 |
| commit | f72a1856cb51db1efa3c799c1e489a152026566b (patch) | |
| tree | 7c833bede9ec33629cd1a7ecc3ab0925cc7fcf71 /libtemplate/xmlparser.c | |
| parent | f2f7246c0b02f37a47ebf888c4d7aa1eadd77662 (diff) | |
| download | vdr-plugin-skindesigner-f72a1856cb51db1efa3c799c1e489a152026566b.tar.gz vdr-plugin-skindesigner-f72a1856cb51db1efa3c799c1e489a152026566b.tar.bz2 | |
added skinsetup to globals
Diffstat (limited to 'libtemplate/xmlparser.c')
| -rw-r--r-- | libtemplate/xmlparser.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libtemplate/xmlparser.c b/libtemplate/xmlparser.c index dd93a0d..01b48a6 100644 --- a/libtemplate/xmlparser.c +++ b/libtemplate/xmlparser.c @@ -128,11 +128,8 @@ bool cXmlParser::ReadSkinSetup(cSkinSetup *skinSetup, string skin, string xmlFil this->skinSetup = skinSetup; string xmlPath = *cString::sprintf("%s%s/%s", *config.skinPath, skin.c_str(), xmlFile.c_str()); - esyslog("skindesigner: reading skin setup %s", xmlPath.c_str()); - if (!FileExists(xmlPath)) return false; - if (ctxt == NULL) { esyslog("skindesigner: Failed to allocate parser context"); return false; @@ -151,12 +148,9 @@ bool cXmlParser::ReadSkinSetup(cSkinSetup *skinSetup, string skin, string xmlFil esyslog("skindesigner: Failed to validate %s", xmlPath.c_str()); return false; } - if (root == NULL) { - esyslog("skindesigner: ERROR: Skin Setup %s is empty", xmlPath.c_str()); return false; } - if (xmlStrcmp(root->name, (const xmlChar *) "setup")) { return false; } @@ -271,8 +265,6 @@ bool cXmlParser::ParseGlobals(void) { } bool cXmlParser::ParseSkinSetup(string skin) { - esyslog("skindesigner: parsing skinsetup from %s", skin.c_str()); - xmlNodePtr node = root->xmlChildrenNode; while (node != NULL) { @@ -284,6 +276,10 @@ bool cXmlParser::ParseSkinSetup(string skin) { ParseSetupParameter(node->xmlChildrenNode); node = node->next; continue; + } else if (!xmlStrcmp(node->name, (const xmlChar *) "translations")) { + ParseTranslations(node->xmlChildrenNode); + node = node->next; + continue; } node = node->next; } @@ -610,7 +606,11 @@ void cXmlParser::ParseTranslations(xmlNodePtr node) { xmlFree(value); nodeTrans = nodeTrans->next; } - globals->translations.insert(pair<string, map < string, string > >((const char*)tokenName, tokenTranslations)); + if (globals) { + globals->translations.insert(pair<string, map < string, string > >((const char*)tokenName, tokenTranslations)); + } else if (skinSetup) { + skinSetup->SetTranslation((const char*)tokenName, tokenTranslations); + } xmlFree(tokenName); node = node->next; } |
