Accept absolute icon path in tpk manifest 60/58360/3
authorTomasz Iwanek <t.iwanek@samsung.com>
Thu, 28 Jan 2016 14:16:51 +0000 (15:16 +0100)
committerTomasz Iwanek <t.iwanek@samsung.com>
Mon, 1 Feb 2016 09:03:46 +0000 (10:03 +0100)
StepTpkPatchIcons will try to look for icon in alternative
location only if source path do not exist.

Requires to be submitted with:
 - https://review.tizen.org/gerrit/#/c/58358/

Change-Id: I4b1a60a8aaab9fa0018d05b8ebbdcd79efc9aef6

src/common/step/step_parse_manifest.cc

index fa99c7f..4c13393 100644 (file)
@@ -488,11 +488,16 @@ bool StepParseManifest::FillApplicationIconPaths(application_x* app,
                                          const T& icons_info) {
   for (auto& application_icon : icons_info.icons()) {
     icon_x* icon = reinterpret_cast<icon_x*> (calloc(1, sizeof(icon_x)));
+    bf::path text;
+    if (bf::path(application_icon.path()).is_absolute()) {
+      text = application_icon.path();
+    } else {
+      text = context_->root_application_path.get()
+          / context_->pkgid.get() / "shared" / "res" / application_icon.path();
+    }
     // NOTE: name is an attribute, but the xml writer uses it as text.
     // This must be fixed in whole app-installer modules, including wgt.
     // Current implementation is just for compatibility.
-    bf::path text = context_->root_application_path.get()
-        / context_->pkgid.get() / "shared" / "res" / application_icon.path();
     icon->text = strdup(text.c_str());
     icon->name = strdup(application_icon.path().c_str());
     icon->lang = strdup(DEFAULT_LOCALE);