TizenRefApp-9197 Fix sonar issues 14/145714/3
authorEvgen Servetnik <e.servetnik@samsung.com>
Wed, 23 Aug 2017 10:33:20 +0000 (13:33 +0300)
committerEvgen Servetnik <e.servetnik@samsung.com>
Wed, 23 Aug 2017 12:32:15 +0000 (15:32 +0300)
Change-Id: I9976542d02c25dfec438eb23bbe3b69ccd61cf42
Signed-off-by: Evgen Servetnik <e.servetnik@samsung.com>
inc/common-efl.h
src/common-efl.c
src/notification-setting-info.c

index 5c6672bf7c4f3574bd7a53f8a1c2f376e9f61671..b3b62634798fb2603fc6d5a0f823726d9f87557f 100755 (executable)
@@ -76,13 +76,6 @@ void set_app_ui_data(ug_data *data);
  */
 Evas_Object *create_layout(Evas_Object *parent);
 
-/**
- * @brief Creates background layout for "Notifications on Lockscreen" view.
- * @param[in] parent parent object.
- * @return created background layout.
- */
-Evas_Object *create_background(Evas_Object *parent);
-
 /**
  * @brief Creates a naviframe based on specified parent object.
  * @param[in] parent parent object.
index 5d28d4d850b2c80478fad0e0793185ad63c1d3c2..56441791427c0f4e971cff3c25bebd853e39a055 100755 (executable)
@@ -63,20 +63,6 @@ Evas_Object *create_layout(Evas_Object *parent)
        return layout;
 }
 
-Evas_Object *create_background(Evas_Object *parent)
-{
-       Evas_Object *bg = NULL;
-
-       bg = elm_bg_add(parent);
-
-       evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-       elm_object_style_set(bg, "default");
-
-       evas_object_show(bg);
-
-       return bg;
-}
-
 Evas_Object *create_naviframe(Evas_Object *parent)
 {
        Evas_Object *naviframe = NULL;
@@ -290,9 +276,6 @@ void append_gl_radio_item_list(Evas_Object *genlist, Eina_List* list, char *styl
        Elm_Genlist_Item_Class *itc = elm_genlist_item_class_new();
        ret_if(!itc);
 
-       item_info_s *item;
-       int count = 0;
-
        Evas_Object *radio = elm_radio_add(genlist);
        evas_object_data_set(genlist, "radio", radio);
 
@@ -301,8 +284,9 @@ void append_gl_radio_item_list(Evas_Object *genlist, Eina_List* list, char *styl
        itc->func.content_get = gl_content_get_cb;
        itc->func.del = gl_del_cb;
 
+       int count = 0;
        while (list) {
-               item = (item_info_s *)eina_list_data_get(list);
+               item_info_s *item = (item_info_s *)eina_list_data_get(list);
                item->index = count;
                item->item_style = ITEM_STYLE_RADIO;
                elm_genlist_item_append(genlist,                                                /* genlist object */
@@ -326,13 +310,9 @@ void append_gl_item_list(Evas_Object *genlist, Eina_List *list, int style, char
 {
        NOTISET_TRACE_BEGIN;
 
-       Elm_Object_Item *gen_item = NULL;
        Elm_Genlist_Item_Class *itc = elm_genlist_item_class_new();
        ret_if(!itc);
 
-       item_info_s *item;
-       int count = 0;
-
        if (style == ITEM_STYLE_TYPE_ONE) {
                itc->item_style = "type1";
        } else if (style == ITEM_STYLE_ONE_ICON) {
@@ -344,13 +324,13 @@ void append_gl_item_list(Evas_Object *genlist, Eina_List *list, int style, char
        itc->func.content_get = gl_content_get_cb;
        itc->func.del = gl_del_cb;
 
-       count = eina_list_count(list);
+       int count = eina_list_count(list);
        NOTISET_DBG("count %d", count);
 
        while (list) {
-               item = (item_info_s *)eina_list_data_get(list);
+               item_info_s *item = (item_info_s *)eina_list_data_get(list);
                item->item_style = style;
-               gen_item = elm_genlist_item_append(genlist,                             /* genlist object */
+               Elm_Object_Item *gen_item = elm_genlist_item_append(genlist,                            /* genlist object */
                                                                itc,                                                    /* item class */
                                                                item,                                                   /* item class user data */
                                                                NULL,                                                   /* parent item */
index a0eae4f4185e46d4883d3995193e4fe0d6308a6f..b2eeeb93f5d74dfa0f892ecba92f28f3fafbae23 100755 (executable)
@@ -31,9 +31,6 @@ setting_info_s *setting_info = NULL;
 Eina_Bool create_app_notification_list()
 {
        NOTISET_TRACE_BEGIN;
-       item_info_s *item_info = NULL;
-
-       Eina_List *not_excepted_list = NULL;
        Eina_List *l = NULL;
        void *data;
 
@@ -42,10 +39,10 @@ Eina_Bool create_app_notification_list()
        setting_info = calloc(1, sizeof(setting_info_s));
        retv_if(!setting_info, EINA_FALSE);
 
-       not_excepted_list = create_base_app_notification_list();
+       Eina_List *not_excepted_list = create_base_app_notification_list();
 
        EINA_LIST_FOREACH(not_excepted_list, l, data) {
-               item_info = (item_info_s*) data;
+               item_info_s *item_info = (item_info_s*) data;
                if (item_info->name) {
                        if (item_info->allow_to_notify)
                                setting_info->apps_noti_allowed_list = eina_list_append(setting_info->apps_noti_allowed_list, item_info);
@@ -78,19 +75,17 @@ void update_app_notification_list_on_item(item_info_s *item_info)
 void create_do_not_disturb_application_list()
 {
        NOTISET_TRACE_BEGIN;
-       Eina_List *not_excepted_list = NULL;
        Eina_List *l = NULL;
        void *data;
-       item_info_s *item_info = NULL;
        remove_excepted_apps_list();
 
        setting_info = calloc(1, sizeof(setting_info_s));
        ret_if(!setting_info);
 
-       not_excepted_list = create_base_app_notification_list();
+       Eina_List *not_excepted_list = create_base_app_notification_list();
 
        EINA_LIST_FOREACH(not_excepted_list, l, data) {
-               item_info = (item_info_s*) data;
+               item_info_s *item_info = (item_info_s*) data;
                if (!strcmp(item_info->package_id, CALENDAR_PACKAGE)) {
                        FREEIF(item_info->name);
                        item_info->name = strdup(APP_STRING("IDS_COM_BODY_CALENDAR_EVENTS"));