Fix installation of icons for hybrid applications 60/87360/1
authorPiotr Dabrowski <p.dabrowski2@samsung.com>
Wed, 7 Sep 2016 12:31:12 +0000 (14:31 +0200)
committerPiotr Dabrowski <p.dabrowski2@samsung.com>
Wed, 7 Sep 2016 12:32:11 +0000 (14:32 +0200)
Change-Id: I41ce7308a6e7abb7f55b3fb002639fad580a4c57

src/wgt/step/configuration/step_parse.cc
src/wgt/step/configuration/step_parse.h
src/wgt/step/filesystem/step_wgt_patch_icons.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;
 }
 
index 0effc8f..d2a42dc 100644 (file)
@@ -47,7 +47,7 @@ class StepParse : public common_installer::Step {
   virtual bool LocateConfigFile();
   bool Check(const boost::filesystem::path& widget_path);
 
-  boost::filesystem::path config_;
+  boost::filesystem::path widget_path_;
 
  private:
   std::set<std::string> ExtractPrivileges(
index 2a995b2..01b62fd 100644 (file)
@@ -56,6 +56,7 @@ common_installer::Step::Status StepWgtPatchIcons::process() {
         icon->text = strdup(icon_path.c_str());
       }
     } else {
+      LOG(INFO) << "Application provides no icon. Using Tizen default icon.";
       // create default icon if there is no icon at all
       bf::path icon_path = common_icon_location / app->appid;
       icon_path += ".png";