if (appc->operation) {
xmlTextWriterStartElement(writer, BAD_CAST "operation");
xmlTextWriterWriteAttribute(writer, BAD_CAST "name",
- BAD_CAST appc->operation->name);
+ BAD_CAST appc->operation);
xmlTextWriterEndElement(writer);
}
if (appc->uri) {
xmlTextWriterStartElement(writer, BAD_CAST "uri");
xmlTextWriterWriteAttribute(writer, BAD_CAST "name",
- BAD_CAST appc->uri->name);
+ BAD_CAST appc->uri);
xmlTextWriterEndElement(writer);
}
if (appc->mime) {
xmlTextWriterStartElement(writer, BAD_CAST "mime");
xmlTextWriterWriteAttribute(writer, BAD_CAST "name",
- BAD_CAST appc->mime->name);
+ BAD_CAST appc->mime);
xmlTextWriterEndElement(writer);
}
p->onboot = string_strdup(el->attr("on-boot"));
p->type = string_strdup(el->attr("type"));
+ // FIXME: temporary fix to avoid build break
// app-control
SetChildren(&(p->appcontrol), tree, el, "app-control",
[&](XmlElement *el, appcontrol_x* p){
- p->text = string_strdup(el->content());
-
- // mime
- SetChildren(&(p->mime), tree, el, "mime",
- [&](XmlElement *el, mime_x* p){
- p->text = string_strdup(el->content());
- p->name = string_strdup(el->attr("name"));
- });
-
- // operation
- SetChildren(&(p->operation), tree, el, "operation",
- [&](XmlElement *el, operation_x* p){
- p->text = string_strdup(el->content());
- p->name = string_strdup(el->attr("name"));
- });
-
- // uri
- SetChildren(&(p->uri), tree, el, "uri",
- [&](XmlElement *el, uri_x* p){
- p->text = string_strdup(el->content());
- p->name = string_strdup(el->attr("name"));
- });
+ vector<XmlElement*> v = tree->Children(el, "operation");
+ if (!v.empty())
+ p->operation = string_strdup(v.front()->attr("name"));
+ v = tree->Children(el, "uri");
+ if (!v.empty())
+ p->uri = string_strdup(v.front()->attr("name"));
+ v = tree->Children(el, "mime");
+ if (!v.empty())
+ p->mime = string_strdup(v.front()->attr("name"));
});
// datacontrol
p->type = string_strdup(el->attr("type"));
// NOTE: onboot and auto-restart are in spec, but not in uiapplication_x
+ // FIXME: temporary fix to avoid build break
// app-control
SetChildren(&(p->appcontrol), tree, el, "app-control",
[&](XmlElement *el, appcontrol_x* p){
- p->text = string_strdup(el->content());
-
- // mime
- SetChildren(&(p->mime), tree, el, "mime",
- [&](XmlElement *el, mime_x* p){
- p->text = string_strdup(el->content());
- p->name = string_strdup(el->attr("name"));
- });
-
- // operation
- SetChildren(&(p->operation), tree, el, "operation",
- [&](XmlElement *el, operation_x* p){
- p->text = string_strdup(el->content());
- p->name = string_strdup(el->attr("name"));
- });
-
- // uri
- SetChildren(&(p->uri), tree, el, "uri",
- [&](XmlElement *el, uri_x* p){
- p->text = string_strdup(el->content());
- p->name = string_strdup(el->attr("name"));
- });
+ vector<XmlElement*> v = tree->Children(el, "operation");
+ if (!v.empty())
+ p->operation = string_strdup(v.front()->attr("name"));
+ v = tree->Children(el, "uri");
+ if (!v.empty())
+ p->uri = string_strdup(v.front()->attr("name"));
+ v = tree->Children(el, "mime");
+ if (!v.empty())
+ p->mime = string_strdup(v.front()->attr("name"));
});
// datacontrol
for (const auto& control : app_info_list->controls) {
appcontrol_x* app_control =
static_cast<appcontrol_x*>(calloc(sizeof(appcontrol_x), 1));
- app_control->operation =
- static_cast<operation_x*>(calloc(sizeof(operation_x), 1));
- app_control->operation->name = strdup(control.operation().c_str());
- app_control->mime =
- static_cast<mime_x*>(calloc(sizeof(mime_x), 1));
- app_control->mime->name = strdup(control.mime().c_str());
- app_control->uri =
- static_cast<uri_x*>(calloc(sizeof(uri_x), 1));
- app_control->uri->name = strdup(control.uri().c_str());
+ app_control->operation = strdup(control.operation().c_str());
+ app_control->mime = strdup(control.mime().c_str());
+ app_control->uri = strdup(control.uri().c_str());
LISTADD(manifest->uiapplication->appcontrol, app_control);
}
}