From 52058b0942aeb01f8b0762905458a9eea163e50d Mon Sep 17 00:00:00 2001 From: "mk5004.lee" Date: Tue, 21 Jan 2020 18:17:53 +0900 Subject: [PATCH] Update sample code in document - item_destroy after noti_ex_item_group_add_child Change-Id: I18c9fccefe99ff034abd499ce881d93d3dc6c38a Signed-off-by: mk5004.lee --- notification-ex/api/notification_ex_group.h | 4 ++++ notification-ex/api/notification_ex_internal.h | 18 ++++++++---------- notification-ex/api/notification_ex_item.h | 1 + notification-ex/api/notification_ex_reporter.h | 9 +++++++++ 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/notification-ex/api/notification_ex_group.h b/notification-ex/api/notification_ex_group.h index 5ecc9fb..0b5aa11 100644 --- a/notification-ex/api/notification_ex_group.h +++ b/notification-ex/api/notification_ex_group.h @@ -157,6 +157,8 @@ int noti_ex_item_group_get_app_label(noti_ex_item_h handle, char **label); ret = noti_ex_item_group_create(&group_item, "group_id"); ret = noti_ex_item_button_create(&child_item, "button_id", "button_title"); ret = noti_ex_item_group_add_child(group_item, child_item); + + noti_ex_item_destroy(child_item); } * @endcode */ @@ -229,6 +231,8 @@ int _ex_item_group_foreach_child_cb(noti_ex_item_h handle, void *user_data) { ret = noti_ex_item_button_create(&child_item, "button_id", "button_title"); ret = noti_ex_item_group_add_child(group_item, child_item); + noti_ex_item_destroy(child_item); + ret = noti_ex_item_group_foreach_child(group_item, _ex_item_group_foreach_child_cb, NULL); } * @endcode diff --git a/notification-ex/api/notification_ex_internal.h b/notification-ex/api/notification_ex_internal.h index eda78a1..35c4d5a 100644 --- a/notification-ex/api/notification_ex_internal.h +++ b/notification-ex/api/notification_ex_internal.h @@ -23,21 +23,19 @@ extern "C" { int noti_ex_item_free_string_list(char** list, int count); int noti_ex_item_group_remove_children(noti_ex_item_h handle); -int noti_ex_item_time_set_time(noti_ex_item_h handle, - time_t time); +int noti_ex_item_time_set_time(noti_ex_item_h handle, time_t time); -int noti_ex_style_set_geometry( - noti_ex_style_h handle, noti_ex_geometry_h geometry); -int noti_ex_style_set_color( - noti_ex_style_h handle, noti_ex_color_h color); +int noti_ex_style_set_geometry(noti_ex_style_h handle, + noti_ex_geometry_h geometry); +int noti_ex_style_set_color(noti_ex_style_h handle, noti_ex_color_h color); int noti_ex_style_set_padding(noti_ex_style_h handle, - noti_ex_padding_h padding); + noti_ex_padding_h padding); -int noti_ex_led_info_set_color( - noti_ex_led_info_h handle, noti_ex_color_h color); +int noti_ex_led_info_set_color(noti_ex_led_info_h handle, + noti_ex_color_h color); #ifdef __cplusplus } #endif -#endif /* __TIZEN_APPFW_NOTIFICATION_EX_INTERNAL_H__ */ \ No newline at end of file +#endif /* __TIZEN_APPFW_NOTIFICATION_EX_INTERNAL_H__ */ diff --git a/notification-ex/api/notification_ex_item.h b/notification-ex/api/notification_ex_item.h index b45cd8a..8cb3034 100644 --- a/notification-ex/api/notification_ex_item.h +++ b/notification-ex/api/notification_ex_item.h @@ -2195,6 +2195,7 @@ int noti_ex_item_get_main_type(noti_ex_item_h handle, int *type); ret = noti_ex_item_group_create(&group_item, "group_id"); ret = noti_ex_item_text_create(&text_item, "text_id", "text", "hyperlink"); ret = noti_ex_item_group_add_child(group_item, text_item); + noti_ex_item_destroy(text_item); ret = noti_ex_item_set_main_type(group_item, "text_id", type); } diff --git a/notification-ex/api/notification_ex_reporter.h b/notification-ex/api/notification_ex_reporter.h index f0fb401..908d653 100644 --- a/notification-ex/api/notification_ex_reporter.h +++ b/notification-ex/api/notification_ex_reporter.h @@ -242,7 +242,10 @@ void _reporter_events_error_cb(noti_ex_reporter_h handle, noti_ex_error_e error, ret = noti_ex_item_group_create(&group_item, "group_id"); ret = noti_ex_item_button_create(&child_item, "button_id", "button_title"); ret = noti_ex_item_group_add_child(group_item, child_item); + noti_ex_item_destroy(child_item); + ret = noti_ex_reporter_post(handle, group_item, &request_id); + noti_ex_item_destroy(group_item); } * @endcode */ @@ -286,12 +289,18 @@ void _reporter_events_error_cb(noti_ex_reporter_h handle, noti_ex_error_e error, ret = noti_ex_item_group_create(¬i_list[0], "group_id1"); ret = noti_ex_item_button_create(&child_item, "button_id1", "button_title"); ret = noti_ex_item_group_add_child(noti_list[0], child_item); + noti_ex_item_destroy(child_item); ret = noti_ex_item_group_create(¬i_list[1], "group_id2"); ret = noti_ex_item_button_create(&child_item, "button_id2", "button_title"); ret = noti_ex_item_group_add_child(noti_list[1], child_item); + noti_ex_item_destroy(child_item); ret = noti_ex_reporter_post_list(handle, noti_list, 2, &request_id); + noti_ex_item_destroy(noti_list[0]); + noti_ex_item_destroy(noti_list[1]); + + free(noti_list); } * @endcode */ -- 2.7.4