From 229b1274a5c7bd8bf4d1b101dab83094ff3f9c06 Mon Sep 17 00:00:00 2001 From: louis Date: Fri, 13 Mar 2015 18:00:39 +0100 Subject: checking setup conditions for viewelements --- libtemplate/xmlparser.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'libtemplate/xmlparser.c') diff --git a/libtemplate/xmlparser.c b/libtemplate/xmlparser.c index aa7d498..f5f3d6e 100644 --- a/libtemplate/xmlparser.c +++ b/libtemplate/xmlparser.c @@ -191,7 +191,7 @@ bool cXmlParser::ParseView(void) { } else if (view->ValidViewElement((const char*)node->name)) { xmlAttrPtr attr = node->properties; vector > attribs; - ParseAttributes(attr, node, attribs); + ParseAttributes(attr, node, attribs, true); ParseViewElement(node->name, node->xmlChildrenNode, attribs); } else if (view->ValidViewList((const char*)node->name)) { ParseViewList(node); @@ -682,7 +682,7 @@ bool cXmlParser::ParseSubView(xmlNodePtr node) { if (subView->ValidViewElement((const char*)childNode->name)) { xmlAttrPtr attr = childNode->properties; vector > attribs; - ParseAttributes(attr, childNode, attribs); + ParseAttributes(attr, childNode, attribs, true); ParseViewElement(childNode->name, childNode->xmlChildrenNode, attribs, subView); } else if (subView->ValidViewList((const char*)childNode->name)) { ParseViewList(childNode, subView); @@ -954,7 +954,7 @@ void cXmlParser::ParseLoopFunctionCalls(xmlNodePtr node, cTemplateLoopFunction * } } -bool cXmlParser::ParseAttributes(xmlAttrPtr attr, xmlNodePtr node, vector > &attribs) { +bool cXmlParser::ParseAttributes(xmlAttrPtr attr, xmlNodePtr node, vector > &attribs, bool isViewElement) { if (attr == NULL) { return false; } @@ -965,15 +965,16 @@ bool cXmlParser::ParseAttributes(xmlAttrPtr attr, xmlNodePtr node, vectorname; + /* if (!name.compare("debug")) { attribs.push_back(pair((const char*)attr->name, "true")); attr = attr->next; continue; } - + */ xmlChar *value = NULL; value = xmlGetProp(node, attr->name); - if (!view->ValidAttribute((const char*)node->name, (const char*)attr->name)) { + if (!view->ValidAttribute(isViewElement ? "viewelement" : (const char*)node->name, (const char*)attr->name)) { esyslog("skindesigner: unknown attribute %s in %s", (const char*)attr->name, (const char*)node->name); attr = attr->next; if (value) -- cgit v1.2.3