From: Wojciech Kosowicz Date: Mon, 24 Aug 2015 09:48:50 +0000 (+0200) Subject: Setting proper icon name in tpk manifest X-Git-Tag: accepted/tizen/mobile/20150828.011739~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F40%2F46640%2F4;p=platform%2Fcore%2Fappfw%2Fapp-installers.git Setting proper icon name in tpk manifest Also included style fixes for the project Change-Id: I2e6ebc71f408e7df91684bc166c435271e27ca73 --- 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;