jaehwan pushed a commit to branch master. http://git.enlightenment.org/tools/eflete.git/commit/?id=219be7b55cc698af11c3e1a55d50fd4471ea584d
commit 219be7b55cc698af11c3e1a55d50fd4471ea584d Author: Jaehwan Kim <[email protected]> Date: Wed Aug 17 19:06:39 2016 +0900 import_edj: fix the style loading method. 1. The all group that includes style name is loaded. 2. The style name should be same exactly. 3. When the group is copied, the origin group isn't loaded. @fix Fixes T4346 --- .../project_manager/project_manager_import_edj.c | 20 +++++++++---------- src/bin/ui/tab_home_import_edj.c | 23 +++++++++++----------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/src/bin/project_manager/project_manager_import_edj.c b/src/bin/project_manager/project_manager_import_edj.c index cd39d81..1356063 100644 --- a/src/bin/project_manager/project_manager_import_edj.c +++ b/src/bin/project_manager/project_manager_import_edj.c @@ -187,22 +187,22 @@ _project_import_edj(void *data) strbuf = eina_strbuf_new(); eina_strbuf_append_printf(strbuf, "edje_pick -o %s -i %s", edj_out, edj_in); - /* load any group for coping */ - if (ptd->widgets) - { - obj = edje_edit_object_add(evas_object_evas_get(ap.win)); - if (!edje_object_file_set(obj, edj_in, eina_list_data_get(ptd->widgets))) - { - CRIT("Can't load object"); - abort(); - } - } EINA_LIST_FOREACH(ptd->widgets, l, group) { if ((group[0] == 'c') && (group[1] == 'p') && (group[2] == '*') && (group[3] == '*') && (group[4] == '*')) { char **arr = eina_str_split(group, "***", 0); you_shall_not_pass_editor_signals(NULL); + /* load any group for coping */ + if (!obj) + { + obj = edje_edit_object_add(evas_object_evas_get(ap.win)); + if (!edje_object_file_set(obj, edj_in, arr[1])) + { + CRIT("Can't load object"); + abort(); + } + } if (!editor_group_copy(obj, arr[1], arr[2])) { CRIT("Can not copy group %s, to %s", arr[1], arr[2]); diff --git a/src/bin/ui/tab_home_import_edj.c b/src/bin/ui/tab_home_import_edj.c index e2c1e27..87a0bd5 100644 --- a/src/bin/ui/tab_home_import_edj.c +++ b/src/bin/ui/tab_home_import_edj.c @@ -620,9 +620,9 @@ _genlist_style_selected_set(Node *item, Eina_List *styles, Eina_Bool selected) { Eina_List *l, *l1, *cp_style_list; Node *node; - Eina_Stringshare *name, *name1, *style_name, *tmp; - const char *pos; + Eina_Stringshare *name, *name1, *sname, *style_name, *tmp; char cp_style[256]; + int len; assert (item != NULL); @@ -640,22 +640,21 @@ _genlist_style_selected_set(Node *item, Eina_List *styles, Eina_Bool selected) EINA_LIST_FOREACH(styles, l, name) { style_name = option_style_name_get(name, &cp_style_list); - if (!strcmp(style_name, "default")) - { - pos = string_rstr(item->name, "base/default"); - if (pos) tab_edj.widget_list = eina_list_append(tab_edj.widget_list, item->name); - } - else + sname = style_name_get(item->name); + if (!strcmp(sname, style_name)) { - pos = string_rstr(item->name, style_name); - if (pos) + if (!cp_style_list) { item->check = selected; tab_edj.widget_list = eina_list_append(tab_edj.widget_list, item->name); + } + else + { EINA_LIST_FOREACH(cp_style_list, l1, name1) { - strncpy(cp_style, item->name, pos - item->name - 1); - cp_style[pos - item->name] = '\0'; + len = strlen(item->name) - strlen(sname); + strncpy(cp_style, item->name, len - 1); + cp_style[len - 1] = '\0'; tmp = eina_stringshare_printf("cp***%s***%s/%s", item->name, cp_style, name1); tab_edj.widget_list = eina_list_append(tab_edj.widget_list, tmp); } --
