From 3b71a2699e09b201cb9fe5e8fb19e3712ee61720 Mon Sep 17 00:00:00 2001 From: Wojciech Kosowicz Date: Mon, 24 Aug 2015 11:48:50 +0200 Subject: [PATCH] Setting proper icon name in tpk manifest Also included style fixes for the project Change-Id: I2e6ebc71f408e7df91684bc166c435271e27ca73 --- src/tpk/step/step_copy_manifest_xml.cc | 12 ++++++++++++ src/wgt/step/step_generate_xml.cc | 4 ++-- src/wgt/step/step_parse_recovery.h | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/tpk/step/step_copy_manifest_xml.cc b/src/tpk/step/step_copy_manifest_xml.cc index bb71e26..f327589 100644 --- a/src/tpk/step/step_copy_manifest_xml.cc +++ b/src/tpk/step/step_copy_manifest_xml.cc @@ -70,6 +70,8 @@ namespace { boost::regex_constants::ECMAScript); boost::regex manifest_type_replace_pattern(").*(?=<\/icon>)", + boost::regex_constants::perl); boost::smatch m; @@ -79,6 +81,16 @@ namespace { try { // Find (ui|service)-application element, and get appid + if (boost::regex_search(line, m, icon_replace_pattern)) { + bf::path match_result(m[0].str()); + bf::path extension = match_result.extension(); + result = boost::regex_replace(line, + icon_replace_pattern, + std::string(context_->manifest_data.get()->mainapp_id + + extension.native())); + // TODO(w.kosowicz): internatialization when supported + } + // Find (ui|service)-application element, and get appid if (boost::regex_search(line, m, appid_pattern)) { pkg_path /= bf::path("bin"); diff --git a/src/wgt/step/step_generate_xml.cc b/src/wgt/step/step_generate_xml.cc index 88c702e..95812f8 100755 --- a/src/wgt/step/step_generate_xml.cc +++ b/src/wgt/step/step_generate_xml.cc @@ -44,8 +44,8 @@ static void _writeServiceApplicationAttributes( } template -common_installer::Step::Status StepGenerateXml::GenerateApplicationCommonXml(T* app, - xmlTextWriterPtr writer) { +common_installer::Step::Status StepGenerateXml::GenerateApplicationCommonXml( + T* app, xmlTextWriterPtr writer) { // common appributes among uiapplication_x and serviceapplication_x xmlTextWriterWriteAttribute(writer, BAD_CAST "appid", BAD_CAST app->appid); diff --git a/src/wgt/step/step_parse_recovery.h b/src/wgt/step/step_parse_recovery.h index a117452..db6a349 100644 --- a/src/wgt/step/step_parse_recovery.h +++ b/src/wgt/step/step_parse_recovery.h @@ -24,7 +24,7 @@ namespace parse { */ class StepParseRecovery : public StepParse { public: - StepParseRecovery(common_installer::ContextInstaller* context); + explicit StepParseRecovery(common_installer::ContextInstaller* context); Status process() override; Status precheck() override; -- 2.7.4