if (new_item->icon_path_str) free(new_item->icon_path_str);
new_item->icon_path_str = malloc(MAX_FILE_PATH_LEN);
+ if (!new_item->icon_path_str) {
+ __E("Malloc unable to assign memory for icon_path_str");
+ goto ERROR;
+ }
snprintf(new_item->icon_path_str, MAX_FILE_PATH_LEN, "%s", util_get_res_file_path(IMAGE_DIR"/default_app_icon.png"));
}
return true;
Eina_List *find_list;
EINA_LIST_FOREACH(list, find_list, item) {
- if (item != NULL && !strcmp(item->app_id,app_id)) {
+ if (item != NULL && !strcmp(item->app_id, app_id)) {
apps_data_delete_item(item);
break;
}
return;
}
Edje_Message_Float_Set *msg = malloc(sizeof(*msg) + sizeof(double));
+ if (!msg) {
+ return;
+ }
msg->count = 1;
msg->val[0] = pos*APPS_VIEW_BG_OPACITY;
return;
}
Edje_Message_Float_Set *msg = malloc(sizeof(*msg) + 3 * sizeof(double));
+ if (!msg) {
+ return;
+ }
msg->count = 3;
msg->val[0] = ((APPS_VIEW_ANIMATION_DELTA * pos) / apps_view_s.height);
msg->val[1] = 1+((APPS_VIEW_ANIMATION_DELTA * pos) / apps_view_s.height);
app_data_t *item = NULL;
Eina_List *find_list;
int item_count = 0;
+ double item_count_double = 0.0;
if (!apps_view_s.opened_folder)
return;
if (item->parent_db_id == apps_view_s.opened_folder->db_id) {
apps_view_icon_set(item);
item_count++;
+ item_count_double = item_count_double + 1.0;
}
}
if (item_count < APPS_FOLDER_MAX_ITEM) {
Edje_Message_Float_Set *msg = malloc(sizeof(*msg) + 2 * sizeof(double));
+ if (!msg) {
+ return;
+ }
msg->count = 2;
- msg->val[0] = item_count / APPS_FOLDER_COL;
+ msg->val[0] = item_count_double / APPS_FOLDER_COL;
msg->val[1] = item_count % APPS_FOLDER_COL;
if (apps_view_get_state() != VIEW_STATE_CHOOSER) {
}
}
- if (item->parent_db_id != APPS_ROOT )
+ if (item->parent_db_id != APPS_ROOT)
__apps_view_badge_update_folder(item->parent_db_id);
}
__D("current page %d", apps_view_s.current_page);
char *buf = (char *)malloc(sizeof(char)*1024);
+ if (!buf) {
+ return;
+ }
snprintf(buf, 1024, _("IDS_HS_TBOPT_PAGE_P1SD_OF_P2SD"), apps_view_s.current_page + 1, apps_view_s.page_count);
screen_reader_read(buf);
screen_reader_update(APPS);
{
if (apps_view_s.view_state == VIEW_STATE_CHOOSER) {
access_info_t *title = (access_info_t *) malloc(sizeof(access_info_t));
+ if (!title) {
+ return;
+ }
title->is_access_obj = EINA_FALSE;
title->target = (Evas_Object *) edje_object_part_object_get(elm_layout_edje_get(apps_view_s.chooser_btn), APPS_CHOOSER_MIDDLE_LABEL);
title->parent = apps_view_s.chooser_btn;
*list = eina_list_append(*list, title);
access_info_t *cancel_btn = (access_info_t *) malloc(sizeof(access_info_t));
+ if (!cancel_btn) {
+ if (title) {
+ free(title);
+ }
+ return;
+ }
cancel_btn->is_access_obj = EINA_FALSE;
cancel_btn->target = (Evas_Object *) edje_object_part_object_get(elm_layout_edje_get(apps_view_s.chooser_btn), "chooser_left_clickable_space");
cancel_btn->parent = apps_view_s.chooser_btn;
*list = eina_list_append(*list, cancel_btn);
access_info_t *done_btn = (access_info_t *) malloc(sizeof(access_info_t));
+ if (!done_btn) {
+ free(cancel_btn);
+ free(title);
+ return;
+ }
done_btn->is_access_obj = EINA_FALSE;
done_btn->target = (Evas_Object *) edje_object_part_object_get(elm_layout_edje_get(apps_view_s.chooser_btn), "chooser_right_clickable_space");
done_btn->parent = apps_view_s.chooser_btn;
char buf[STR_MAX] = { 0, };
access_info_t *info = (access_info_t *)malloc(sizeof(access_info_t));
+ if (!info) {
+ return;
+ }
info->is_access_obj = EINA_FALSE;
info->target = item->app_layout;
info->parent = item->app_layout;
int page_index = item->position / (APPS_VIEW_COL*APPS_VIEW_ROW);
if (page_index == apps_view_s.current_page) {
access_info_t *info = (access_info_t *)malloc(sizeof(access_info_t));
+ if (!info) {
+ return;
+ }
info->is_access_obj = EINA_FALSE;
info->target = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(item->app_layout), APPS_ICON_UNINSTALL_BUTTON);
info->parent = item->app_layout;
folder_text = elm_object_text_get(apps_view_s.folder_title_entry);
access_info_t *info = (access_info_t *)malloc(sizeof(access_info_t));
+ if (!info) {
+ return;
+ }
info->is_access_obj = EINA_FALSE;
info->target = apps_view_s.folder_title_entry;
info->parent = apps_view_s.opened_folder->folder_layout;
EINA_LIST_FOREACH(data_list, find_list, item) {
if (item->parent_db_id == apps_view_s.opened_folder->db_id) {
access_info_t *info = (access_info_t *)malloc(sizeof(access_info_t));
+ if (!info) {
+ return;
+ }
info->is_access_obj = EINA_FALSE;
info->target = item->app_layout;
info->parent = apps_view_s.opened_folder->folder_layout;
int pos = item_count;
if (apps_view_s.view_state != VIEW_STATE_CHOOSER) {
access_info_t *info = (access_info_t *)malloc(sizeof(access_info_t));
+ if (!info) {
+ return;
+ }
info->is_access_obj = EINA_FALSE;
info->target = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(apps_view_s.folder_popup_ly), APPS_FOLDER_PLUS_ICON);
info->parent = apps_view_s.win;
EINA_LIST_FOREACH(data_list, find_list, item) {
if (item->parent_db_id == apps_view_s.opened_folder->db_id) {
access_info_t *info = (access_info_t *)malloc(sizeof(access_info_t));
+ if (!info) {
+ return;
+ }
info->is_access_obj = EINA_FALSE;
info->target = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(item->app_layout), APPS_ICON_UNINSTALL_BUTTON);
info->parent = item->app_layout;
int i, j;
__cluster_page_get_widget_size(type, &w, &h);
- if (!(pos_x >= 0 && pos_x <=CLUSTER_COL && pos_y >=0 && pos_y <=CLUSTER_ROW))
+ if (!(pos_x >= 0 && pos_x <= CLUSTER_COL && pos_y >= 0 && pos_y <= CLUSTER_ROW))
return false;
for (i = 0; i < h; i++) {
EINA_LIST_FOREACH(page_t->widget_list, find_list, item) {
access_info_t *info = (access_info_t *)malloc(sizeof(access_info_t));
+ if (!info) {
+ return;
+ }
info->is_access_obj = EINA_FALSE;
info->target = is_edit ? item->widget_layout : item->widget_content;
info->parent = item->widget_content;
char buf[STR_MAX] = { 0, };
snprintf(buf, sizeof(buf), _("IDS_HS_TBOPT_PAGE_P1SD_OF_P2SD"), page_item->page_index + 1, cluster_view_s.page_count);
access_info_t *info = (access_info_t *)malloc(sizeof(access_info_t));
+ if (!info) {
+ return;
+ }
info->is_access_obj = EINA_FALSE;
info->target = page_item->thumbnail_ly;
info->parent = page_item->page_layout;
EINA_LIST_FOREACH(cluster_view_s.page_list, find_list, page_item) {
if (page_item->thumbnail_ly) {
access_info_t *info = (access_info_t *)malloc(sizeof(access_info_t));
+ if (!info) {
+ return;
+ }
info->is_access_obj = EINA_FALSE;
info->target = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(page_item->thumbnail_ly), CLUSTER_ALLPAGE_DELETE_BUTTON);
info->parent = page_item->thumbnail_ly;
{
if (cluster_view_s.allpage_add_page) {
access_info_t *info = (access_info_t *)malloc(sizeof(access_info_t));
+ if (!info) {
+ return;
+ }
info->is_access_obj = EINA_FALSE;
info->target = cluster_view_s.allpage_add_page;
info->parent = cluster_view_s.allpage_grid;
menu_btn = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(main_info.btn_layout), MENU_BUTTON);
btn_info = (access_info_t *)malloc(sizeof(access_info_t));
+ if (!btn_info) {
+ return;
+ }
btn_info->is_access_obj = EINA_FALSE;
btn_info->target = menu_btn;
btn_info->parent = main_info.btn_layout;
apps_btn = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(main_info.btn_layout), HOME_BUTTON);
btn_info = (access_info_t *)malloc(sizeof(access_info_t));
+ if (!btn_info) {
+ return;
+ }
btn_info->is_access_obj = EINA_FALSE;
btn_info->target = apps_btn;
btn_info->parent = main_info.btn_layout;
home_btn = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(main_info.btn_layout), HOME_BUTTON);
btn_info = (access_info_t *)malloc(sizeof(access_info_t));
+ if (!btn_info) {
+ return;
+ }
btn_info->is_access_obj = EINA_FALSE;
btn_info->target = home_btn;
btn_info->parent = main_info.btn_layout;
{
char *err_str = NULL;
- switch(err) {
+ switch (err) {
case APP_CONTROL_ERROR_INVALID_PARAMETER:
err_str = "APP_CONTROL_ERROR_INVALID_PARAMETER";
break;
if (scroller == NULL)
return NULL;
page_indicator = (page_indicator_t *)malloc(sizeof(page_indicator_t));
+ if (!page_indicator) {
+ __E("malloc unable to assign memory to page_indicator");
+ return NULL;
+ }
page_indicator->scroller = scroller;
page_indicator->page_count = 0;
page_indicator->current_page = -1;
if (count < PAGE_INDICATOR_MAX_PAGE_COUNT) {
width = count * PAGE_INDICATOR_UNIT + (PAGE_INDICATOR_GAP * (count-1));
- }
- else {
+ } else {
width = PAGE_INDICATOR_MAX_PAGE_COUNT * PAGE_INDICATOR_UNIT + (PAGE_INDICATOR_GAP * (PAGE_INDICATOR_MAX_PAGE_COUNT - 1));
}
if (page_indicator->page_count == count) {
if (page < center_left) {
indicator = page;
- }
- else if (page >= center_left && page <= center_right) {
+ } else if (page >= center_left && page <= center_right) {
indicator = PAGE_INDICATOR_CENTER_PAGE_INDEX;
- }
- else {
+ } else {
indicator = page - center_right + PAGE_INDICATOR_CENTER_PAGE_INDEX;
}
- }
- else {
+ } else {
indicator = page;
}
int i = 0;
int max_unit_count = page_indicator->page_count < PAGE_INDICATOR_MAX_PAGE_COUNT ? page_indicator->page_count : PAGE_INDICATOR_MAX_PAGE_COUNT;
- for (i = 0; i < max_unit_count; i++)
- {
+ for (i = 0; i < max_unit_count; i++) {
double angle = 0.0;
if (i == prev_unit)
angle = prev_unit_angle;
cur_indicator_unit = __page_indicator_get_indicator_unit(page_indicator->page_count, page_indicator->current_page);
- for (i = 0; i < PAGE_INDICATOR_MAX_PAGE_COUNT; i++)
- {
+ for (i = 0; i < PAGE_INDICATOR_MAX_PAGE_COUNT; i++) {
Evas_Object *edje = NULL;
edje = elm_layout_edje_get(page_indicator->unit[i]);
snprintf(cur_page_num, sizeof(cur_page_num), "%d", page_indicator->current_page + 1);
if (i == cur_indicator_unit) {
edje_object_signal_emit(edje, SIGNAL_PAGE_INDICATOR_CURRENT, SIGNAL_SOURCE);
page_indicator->unit_angle[i] = 90.0;
- }
- else {
+ } else {
edje_object_signal_emit(edje, SIGNAL_PAGE_INDICATOR_DEFAULT, SIGNAL_SOURCE);
page_indicator->unit_angle[i] = 0.0;
}
}
Edje_Message_Float_Set *msg = malloc(sizeof(*msg) + 2 * sizeof(double));
+ if (!msg) {
+ return;
+ }
msg->count = 2;
msg->val[0] = angle;
msg->val[1] = alpha;
access_info_t *widget_viewer_get_accessible_delete_btn(widget_data_t *widget_data)
{
access_info_t *btn_info = (access_info_t *)malloc(sizeof(access_info_t));
+ if (!btn_info) {
+ __E("Malloc failed to assign memory to info");
+ return NULL;
+ }
btn_info->is_access_obj = EINA_FALSE;
btn_info->target = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(widget_data->widget_layout), WIDGET_DELETE_BUTTON);
btn_info->parent = widget_data->widget_layout;