Fix installation of icons for hybrid applications
[platform/core/appfw/wgt-backend.git] / src / wgt / step / configuration / step_parse.cc
index 0218240..b2b4822 100644 (file)
@@ -55,6 +55,7 @@ const char kTizenPackageXmlNamespace[] = "http://tizen.org/ns/packages";
 const char kImeCategoryName[] = "http://tizen.org/category/ime";
 
 const char kResWgt[] = "res/wgt";
+const char kConfigFileName[] = "config.xml";
 
 GList* GenerateMetadataListX(const wgt::parse::MetaDataInfo& meta_info) {
   GList* list = nullptr;
@@ -161,8 +162,7 @@ bool StepParse::FillIconPaths(manifest_x* manifest) {
     icons_info.reset(new wgt::parse::ApplicationIconsInfo());
   }
   wgt::parse::LocalizedApplicationIconsInfo localized_list =
-      wgt::parse::GetLocalizedIconList(*icons_info,
-                                       context_->unpacked_dir_path.get());
+      wgt::parse::GetLocalizedIconList(*icons_info, widget_path_);
   // We need to generate icon for each locale and icons are already set into
   // lookup order. There isn't said that all icons should be received from
   // one <icon> tag position so we iterate utils we run out of icons creating
@@ -646,7 +646,7 @@ common_installer::Step::Status StepParse::process() {
   }
 
   parser_.reset(new wgt::parse::WidgetConfigParser());
-  if (!parser_->ParseManifest(config_)) {
+  if (!parser_->ParseManifest(widget_path_ / kConfigFileName)) {
     LOG(ERROR) << "[Parse] Parse failed. " <<  parser_->GetErrorMessage();
     return common_installer::Step::Status::PARSE_ERROR;
   }
@@ -757,14 +757,14 @@ common_installer::Step::Status StepParse::process() {
 }
 
 bool StepParse::Check(const boost::filesystem::path& widget_path) {
-  boost::filesystem::path config = widget_path / "config.xml";
+  LOG(DEBUG) << "unpacked widget path: " << widget_path;
 
-  LOG(DEBUG) << "config.xml path: " << config;
+  widget_path_ = widget_path;
 
+  boost::filesystem::path config = widget_path / kConfigFileName;
+  LOG(DEBUG) << "config.xml path: " << config;
   if (!boost::filesystem::exists(config))
     return false;
-
-  config_ = config;
   return true;
 }