Fix appcontrol on parse & generate xml 92/40592/3 accepted/tizen_3.0.2015.q2_common tizen_3.0.2015.q2_common accepted/tizen/3.0.2015.q2/common/20150609.181940 accepted/tizen/3.0.2015.q2/common/20150615.091813 accepted/tizen/common/20150609.084321 accepted/tizen/mobile/20150609.085839 accepted/tizen/tv/20150612.003522 accepted/tizen/wearable/20150609.085900 submit/tizen/20150605.114228 submit/tizen_3.0.2015.q2_common/20150609.170642 submit/tizen_3.0.2015.q2_common/20150615.075539 submit/tizen_tv/20150611.000000
authorSangyoon Jang <s89.jang@samsung.com>
Fri, 5 Jun 2015 09:05:26 +0000 (18:05 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Fri, 5 Jun 2015 10:15:49 +0000 (19:15 +0900)
this patch is related with:
https://review.tizen.org/gerrit/#/c/40506/

Change-Id: If9e9eb900d688e794a3436e64a4e4c10662adfd2
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
src/common/step/step_generate_xml.cc
src/tpk/step/step_parse.cc
src/wgt/step/step_parse.cc

index a17b94c..7492ab9 100755 (executable)
@@ -112,21 +112,21 @@ Step::Status StepGenerateXml::GenerateApplicationCommonXml(T* app,
     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);
     }
 
index 4a8435f..9ba373a 100644 (file)
@@ -239,31 +239,19 @@ bool StepParse::SetPkgInfoChildren(manifest_x* m,
     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
@@ -316,31 +304,19 @@ bool StepParse::SetPkgInfoChildren(manifest_x* m,
     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
index aeffd53..1c7105b 100644 (file)
@@ -157,15 +157,9 @@ bool StepParse::FillAppControl(manifest_x* manifest) {
     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);
     }
   }