diff options
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; } |
