From 2ea4a43278a47cac72cdce96997f46be958deb5c Mon Sep 17 00:00:00 2001
From: Piotr Dabrowski
Date: Wed, 7 Sep 2016 14:31:12 +0200
Subject: [PATCH] Fix installation of icons for hybrid applications
Change-Id: I41ce7308a6e7abb7f55b3fb002639fad580a4c57
---
src/wgt/step/configuration/step_parse.cc | 14 +++++++-------
src/wgt/step/configuration/step_parse.h | 2 +-
src/wgt/step/filesystem/step_wgt_patch_icons.cc | 1 +
3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/src/wgt/step/configuration/step_parse.cc b/src/wgt/step/configuration/step_parse.cc
index 0218240..b2b4822 100644
--- a/src/wgt/step/configuration/step_parse.cc
+++ b/src/wgt/step/configuration/step_parse.cc
@@ -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 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;
}
diff --git a/src/wgt/step/configuration/step_parse.h b/src/wgt/step/configuration/step_parse.h
index 0effc8f..d2a42dc 100644
--- a/src/wgt/step/configuration/step_parse.h
+++ b/src/wgt/step/configuration/step_parse.h
@@ -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 ExtractPrivileges(
diff --git a/src/wgt/step/filesystem/step_wgt_patch_icons.cc b/src/wgt/step/filesystem/step_wgt_patch_icons.cc
index 2a995b2..01b62fd 100644
--- a/src/wgt/step/filesystem/step_wgt_patch_icons.cc
+++ b/src/wgt/step/filesystem/step_wgt_patch_icons.cc
@@ -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";
--
2.7.4