From: Junghyun Yeon Date: Tue, 20 Sep 2016 05:05:29 +0000 (+0900) Subject: Put metadata of app-widget into application_x X-Git-Tag: accepted/tizen/common/20160922.120318^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F28%2F88628%2F2;p=platform%2Fcore%2Fappfw%2Fwgt-backend.git Put metadata of app-widget into application_x Put metadata of app-widget at parsing time to Insert it into app metadata db Change-Id: I877fabfc4f324439344632a0a4909b9fe07a7b81 Signed-off-by: Junghyun Yeon --- diff --git a/src/wgt/step/configuration/step_parse.cc b/src/wgt/step/configuration/step_parse.cc index 33bb0b2..914bbc3 100644 --- a/src/wgt/step/configuration/step_parse.cc +++ b/src/wgt/step/configuration/step_parse.cc @@ -70,6 +70,21 @@ GList* GenerateMetadataListX(const wgt::parse::MetaDataInfo& meta_info) { return list; } +void AppendWidgetMetadata(GList** metadatas, + const std::vector> metadata) { + GList* list = *metadatas; + for (auto& meta : metadata) { + metadata_x* new_meta = static_cast(calloc(1, sizeof(metadata_x))); + new_meta->key = strdup(meta.first.c_str()); + if (!meta.second.empty()) + new_meta->value = strdup(meta.second.c_str()); + + list = g_list_append(list, new_meta); + } + + *metadatas = list; +} + void SetApplicationXDefaults(application_x* application) { application->effectimage_type = strdup("image"); application->enabled = strdup("true"); @@ -433,6 +448,9 @@ bool StepParse::FillWidgetApplicationInfo(manifest_x* manifest) { application->icon = g_list_append(application->icon, icon); } + if (!app_widget.metadata.empty()) + AppendWidgetMetadata(&application->metadata, app_widget.metadata); + manifest->application = g_list_append(manifest->application, application); } return true;