Fix N_SE-22664: fix the logic when appending edit field.
authoryigang.jing <yigang.jing@samsung.com>
Thu, 24 Jan 2013 11:32:54 +0000 (20:32 +0900)
committeryigang.jing <yigang.jing@samsung.com>
Thu, 24 Jan 2013 11:32:54 +0000 (20:32 +0900)
Change-Id: If7f939d9a887a334cc34382f93ab4044c1ee54cf

setting-about/src/setting-about-main.c

index 9034bff..fc5ee3a 100755 (executable)
@@ -686,34 +686,39 @@ int setting_about_generate_genlist(void *data)
                SETTING_TRACE(">>>>>>>>>>>>>>>>>> UNINSTALLED PACKAGE");
                ad->item_dev_name = NULL;
        } else {
+               Setting_GenGroupItem_Data *item_data = (Setting_GenGroupItem_Data *)calloc(1, sizeof(Setting_GenGroupItem_Data));
+               setting_retvm_if(!item_data, NULL, "calloc failed");
+
+               item_data->keyStr = (char *)g_strdup(SETTING_ABOUT_DEVICE_NAME_STR);
+               item_data->sub_desc = (char *)g_strdup(pa_sub_desc);
+               item_data->swallow_type = SWALLOW_Type_LAYOUT_ENTRY;
+               item_data->chk_status = 0;
+               item_data->chk_change_cb = __setting_about_device_name_changed_cb;
+               item_data->userdata = ad;
+               item_data->isSinglelineFlag = TRUE;
+               item_data->maxlength_reached_cb = __max_len_reached;
+               item_data->start_change_cb = (setting_call_back_func)__entry_key_down_cb;
+               item_data->stop_change_cb = __entry_unfocus_cb;
+               item_data->x_callback_cb = _input_panel_event_cb;
+
+               item_data->limit_filter_data = calloc(1, sizeof(Elm_Entry_Filter_Limit_Size));
+               if (item_data->limit_filter_data) {
+                       //max byte len is 31 not 31+1
+                       //ad->item_dev_name->limit_filter_data->max_byte_count = MAX_DEVICE_NAME_LEN + OFFESET_ENTRY_FILTER;
+                       item_data->limit_filter_data->max_byte_count = MAX_DEVICE_NAME_LEN;
+                       item_data->win_main = ad->win_get;
+               }
 
-               ad->item_dev_name =
-                       setting_create_Gendial_field_def(scroller, &(itc_1icon),
-                                                                setting_about_main_mouse_up_Gendial_list_cb,
-                                                        ad, SWALLOW_Type_LAYOUT_ENTRY,
-                                                        NULL, NULL, 0, SETTING_ABOUT_DEVICE_NAME_STR, pa_sub_desc,
-                                                        __setting_about_device_name_changed_cb);
-               if (ad->item_dev_name) {
-                       ad->item_dev_name->userdata = ad;
-                       ad->item_dev_name->isSinglelineFlag = TRUE;
-                       ad->item_dev_name->start_change_cb = (setting_call_back_func)__entry_key_down_cb;
-                       ad->item_dev_name->stop_change_cb = __entry_unfocus_cb;
-                       ad->item_dev_name->maxlength_reached_cb = __max_len_reached;
-                       ad->item_dev_name->x_callback_cb = _input_panel_event_cb;
-                       ad->item_dev_name->limit_filter_data = calloc(1, sizeof(Elm_Entry_Filter_Accept_Set));
-
-                       if (ad->item_dev_name->limit_filter_data) {
-                               //max byte len is 31 not 31+1
-                               //ad->item_dev_name->limit_filter_data->max_byte_count = MAX_DEVICE_NAME_LEN + OFFESET_ENTRY_FILTER;
-                               ad->item_dev_name->limit_filter_data->max_byte_count = MAX_DEVICE_NAME_LEN;
-                               ad->item_dev_name->win_main = ad->win_get;
-                       }
-                       //ad->item_dev_name->input_type = ELM_INPUT_PANEL_LAYOUT_NUMBER;
-                       ad->item_dev_name->input_panel_disable_flag = EINA_TRUE;
+               item_data->input_panel_disable_flag = EINA_TRUE;
 
+               item_data->item = elm_genlist_item_append(scroller, &(itc_1icon), item_data, NULL, ELM_GENLIST_ITEM_NONE,
+                                               setting_about_main_mouse_up_Gendial_list_cb, ad);
+
+               ad->item_dev_name = item_data;
+               if (ad->item_dev_name) {
                        elm_genlist_item_select_mode_set(ad->item_dev_name->item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
                } else {
-                               SETTING_TRACE_ERROR("ad->item_dev_name is NULL");
+                       SETTING_TRACE_ERROR("ad->item_dev_name is NULL");
                }
        }
        FREE(pa_sub_desc);