rimmed pushed a commit to branch master. http://git.enlightenment.org/tools/eflete.git/commit/?id=0e65bbb7c2888dc831571c7726d83c53edc3db05
commit 0e65bbb7c2888dc831571c7726d83c53edc3db05 Author: Vyacheslav Reutskiy <v.reuts...@samsung.com> Date: Fri Jun 24 10:25:03 2016 +0300 project manager: remove widget_list usage This list is confused. Project manager have the list of groups for import but imported all groups from given file and all resources. It's wrong. So now we will use this list for import only selected groups. Change-Id: Ie8a5a9a874747f031b4784d0a76740f7ce983a26 --- src/bin/project_manager/group_manager.c | 64 +------------------------------ src/bin/project_manager/project_manager.c | 9 +---- src/bin/project_manager/project_manager.h | 5 +-- src/bin/ui/project_close.c | 2 +- src/bin/ui/project_common.c | 2 +- src/bin/ui/project_common.h | 2 +- src/bin/ui/tab_home_common.c | 10 ++--- src/bin/ui/tab_home_import_edc.c | 4 +- src/bin/ui/tab_home_import_edj.c | 4 +- src/bin/ui/tab_home_new.c | 4 +- src/bin/ui/tabs_private.h | 2 +- 11 files changed, 18 insertions(+), 90 deletions(-) diff --git a/src/bin/project_manager/group_manager.c b/src/bin/project_manager/group_manager.c index 440d235..cbdf10b 100644 --- a/src/bin/project_manager/group_manager.c +++ b/src/bin/project_manager/group_manager.c @@ -797,38 +797,12 @@ gm_group_del(Project *pro, Group *group) resource_free((Resource *)group); } -Eina_Bool -_is_checked(Eina_List *widgets) -{ - Eina_List *l, *ll, *lll; - Tree_Item_Data *widget, *style; - End_Item_Data *item_style; - - EINA_LIST_FOREACH(widgets, l, widget) - { - if (widget->check) return EINA_TRUE; - EINA_LIST_FOREACH(widget->list, ll, style) - { - if (style->check) return EINA_TRUE; - if (style->copy) return EINA_TRUE; - EINA_LIST_FOREACH(style->list, lll, item_style) - if (item_style->check) return EINA_TRUE; - } - } - - return EINA_FALSE; -} - void gm_groups_load(Project *pro) { - Eina_List *collections, *l, *wl, *wll, *wlll; + Eina_List *collections, *l; Eina_Stringshare *group_name; - const char *widget_name; - Tree_Item_Data *widget, *style; - End_Item_Data *item_style; Group *group; - Eina_Bool check, is_checked; assert(pro != NULL); assert(pro->dev != NULL); @@ -838,47 +812,11 @@ gm_groups_load(Project *pro) assert(collections != NULL); - is_checked = _is_checked(pro->widgets); - collections = eina_list_sort(collections, eina_list_count(collections), (Eina_Compare_Cb) strcmp); EINA_LIST_FOREACH(collections, l, group_name) { - check = false; if (!strcmp(group_name, EFLETE_INTERNAL_GROUP_NAME)) continue; - if (pro->widgets && is_checked) - { - widget_name = widget_name_get(group_name); - if (!widget_name) continue; - EINA_LIST_FOREACH(pro->widgets, wl, widget) - { - EINA_LIST_FOREACH(widget->list, wll, style) - { - if (style->check) - { - if (!strcmp(widget->name, widget_name) && - style_name_check(group_name, style->name)) - { - check = true; - break; - } - } - EINA_LIST_FOREACH(style->list, wlll, item_style) - { - if (item_style->check) - { - if (!strcmp(widget->name, widget_name) && - item_style_name_check(group_name, item_style->name, widget->list)) - { - check = true; - break; - } - } - } - } - } - if (!check) continue; - } group = (Group *)resource_add(group_name, RESOURCE_TYPE_GROUP); pro->groups = eina_list_append(pro->groups, group); } diff --git a/src/bin/project_manager/project_manager.c b/src/bin/project_manager/project_manager.c index 730b3a0..c388892 100644 --- a/src/bin/project_manager/project_manager.c +++ b/src/bin/project_manager/project_manager.c @@ -81,9 +81,6 @@ typedef struct Eina_List *widgets; } Project_Thread; - - - static Project_Thread worker; #define WORKER_CREATE(FUNC_PROGRESS, FUNC_END, DATA, PROJECT, \ NAME, PATH, EDJ, EDC, BUILD_OPTIONS, WIDGET_LIST) \ @@ -207,7 +204,6 @@ _project_descriptor_init(void) EET_DATA_DESCRIPTOR_ADD_BASIC(eed_project, Project, "saved_edj", saved_edj, EET_T_STRING); EET_DATA_DESCRIPTOR_ADD_BASIC(eed_project, Project, "develop_path", develop_path, EET_T_STRING); EET_DATA_DESCRIPTOR_ADD_BASIC(eed_project, Project, "release_options", release_options, EET_T_STRING); - EET_DATA_DESCRIPTOR_ADD_LIST_STRING(eed_project, Project, "widgets", widgets); EET_DATA_DESCRIPTOR_ADD_LIST_STRING(eed_project, Project, "images", res.images); EET_DATA_DESCRIPTOR_ADD_LIST_STRING(eed_project, Project, "sounds", res.sounds); EET_DATA_DESCRIPTOR_ADD_LIST_STRING(eed_project, Project, "fonts", res.fonts); @@ -239,15 +235,13 @@ _end_send(void *data __UNUSED__) PM_Project_End_Cb func; PM_Project_Result result; void *udata; - Eina_List *widgets = NULL; /** Copy the links to callback and meesage, to fast release worker resource. */ worker.func_progress = NULL; func = worker.func_end; result = worker.result; udata = worker.data; - widgets = worker.widgets; - func(udata, result, widgets); + func(udata, result); } static Eina_Bool @@ -313,7 +307,6 @@ _project_files_create(void) pro->dev = eina_stringshare_printf("%s/%s.dev", folder_path, worker.name); pro->saved_edj = eina_stringshare_printf("%s/%s.edj", folder_path, worker.name); pro->develop_path = eina_stringshare_printf("%s/develop", folder_path); - pro->widgets = worker.widgets; pro_path = eina_stringshare_printf("%s/%s.pro", folder_path, worker.name); pro->ef = eet_open(pro_path, EET_FILE_MODE_READ_WRITE); diff --git a/src/bin/project_manager/project_manager.h b/src/bin/project_manager/project_manager.h index 681b10a..d7e1183 100644 --- a/src/bin/project_manager/project_manager.h +++ b/src/bin/project_manager/project_manager.h @@ -76,9 +76,6 @@ struct _Project /** compile options for release edj file. see edje_cc reference */ Eina_Stringshare *release_options; - /** The checked widgets. Used for loading just checked widgets. */ - Eina_List *widgets; - Eina_List *groups; Eina_List *images; Eina_List *sounds; @@ -182,7 +179,7 @@ typedef Eina_Bool * @ingroup ProjectManager */ typedef void -(* PM_Project_End_Cb)(void *data, PM_Project_Result result, Eina_List *widgets); +(* PM_Project_End_Cb)(void *data, PM_Project_Result result); /** * Free the Project Thread object. diff --git a/src/bin/ui/project_close.c b/src/bin/ui/project_close.c index a827d42..8444d7a 100644 --- a/src/bin/ui/project_close.c +++ b/src/bin/ui/project_close.c @@ -31,7 +31,7 @@ _progress_print(void *data __UNUSED__, Eina_Stringshare *progress_string) } static void -_progress_end(void *data __UNUSED__, PM_Project_Result result, Eina_List *widgets __UNUSED__) +_progress_end(void *data __UNUSED__, PM_Project_Result result) { switch (result) diff --git a/src/bin/ui/project_common.c b/src/bin/ui/project_common.c index 08efce3..88eb6ce 100644 --- a/src/bin/ui/project_common.c +++ b/src/bin/ui/project_common.c @@ -73,7 +73,7 @@ progress_print(void *data __UNUSED__, Eina_Stringshare *progress_string) } void -progress_end(void *data __UNUSED__, PM_Project_Result result, Eina_List *widgets __UNUSED__) +progress_end(void *data __UNUSED__, PM_Project_Result result) { switch (result) { diff --git a/src/bin/ui/project_common.h b/src/bin/ui/project_common.h index 65aa1fc..6a9cdcf 100644 --- a/src/bin/ui/project_common.h +++ b/src/bin/ui/project_common.h @@ -27,6 +27,6 @@ Eina_Bool progress_print(void *data, Eina_Stringshare *progress_string); void -progress_end(void *data, PM_Project_Result result, Eina_List *widgets); +progress_end(void *data, PM_Project_Result result); #endif /* PROJECT_COMMON_H */ diff --git a/src/bin/ui/tab_home_common.c b/src/bin/ui/tab_home_common.c index 434a852..4854652 100644 --- a/src/bin/ui/tab_home_common.c +++ b/src/bin/ui/tab_home_common.c @@ -126,20 +126,20 @@ _group_copy(Project *pro, Eina_List *widgets) } void -_tabs_progress_end(void *data, PM_Project_Result result, Eina_List *widgets) +_tabs_progress_end(void *data, PM_Project_Result result) { Meta_Data_Controls *meta = (Meta_Data_Controls *)data; if (PM_PROJECT_LOCKED == result) { - progress_end(data, result, NULL); + progress_end(data, result); popup_want_action(_("File is locked"), _("File locked by another application"), NULL, BTN_OK, NULL, NULL); return; } if (PM_PROJECT_ERROR == result) { - progress_end(data, result, NULL); + progress_end(data, result); popup_want_action(_("File opening error"), _("Unknown problem with file appeared.<br>" "(wrong file, filesystem error, no memory, etc)"), NULL, BTN_OK, NULL, NULL); @@ -157,13 +157,13 @@ _tabs_progress_end(void *data, PM_Project_Result result, Eina_List *widgets) project_navigator_project_set(); //tabs_menu_tab_open(TAB_HOME_PROJECT_INFO); - _group_copy(ap.project, widgets); + //_group_copy(ap.project, widgets); config_recent_add(ap.project->name, ap.project->pro_path); _tab_open_project_recents_update(); evas_object_smart_callback_call(ap.win, SIGNAL_PROJECT_OPENED, NULL); - progress_end(data, result, NULL); + progress_end(data, result); } void diff --git a/src/bin/ui/tab_home_import_edc.c b/src/bin/ui/tab_home_import_edc.c index a14ad58..9caf8ed 100644 --- a/src/bin/ui/tab_home_import_edc.c +++ b/src/bin/ui/tab_home_import_edc.c @@ -356,7 +356,7 @@ _progress_print(void *data, Eina_Stringshare *progress_string) } static void -_progress_end(void *data, PM_Project_Result result, Eina_List *widgets) +_progress_end(void *data, PM_Project_Result result) { if (PM_PROJECT_ERROR == result) popup_log_message_helper(eina_strbuf_string_get(tab_edc.log)); @@ -375,7 +375,7 @@ _progress_end(void *data, PM_Project_Result result, Eina_List *widgets) elm_entry_entry_set(tab_edc.meta.licenses, NULL); elm_entry_entry_set(tab_edc.meta.comment, N_("Created with Eflete!")); } - _tabs_progress_end(data, result, widgets); + _tabs_progress_end(data, result); } static Eina_Bool diff --git a/src/bin/ui/tab_home_import_edj.c b/src/bin/ui/tab_home_import_edj.c index c5ac59a..618d73d 100644 --- a/src/bin/ui/tab_home_import_edj.c +++ b/src/bin/ui/tab_home_import_edj.c @@ -423,7 +423,7 @@ _contracted_cb(void *data __UNUSED__, } static void -_progress_end(void *data, PM_Project_Result result, Eina_List *widgets) +_progress_end(void *data, PM_Project_Result result) { if (PM_PROJECT_SUCCESS == result) { @@ -436,7 +436,7 @@ _progress_end(void *data, PM_Project_Result result, Eina_List *widgets) elm_entry_entry_set(tab_edj.meta.comment, N_("Created with Eflete!")); } - _tabs_progress_end(data, result, widgets); + _tabs_progress_end(data, result); } static Eina_Bool diff --git a/src/bin/ui/tab_home_new.c b/src/bin/ui/tab_home_new.c index 6fa1ddb..5ed78e4 100644 --- a/src/bin/ui/tab_home_new.c +++ b/src/bin/ui/tab_home_new.c @@ -430,7 +430,7 @@ _edc_code_generate(Eina_Stringshare *path) /* SPLASH */ static void -_progress_end(void *data, PM_Project_Result result, Eina_List *widgets) +_progress_end(void *data, PM_Project_Result result) { if (PM_PROJECT_SUCCESS == result) { @@ -442,7 +442,7 @@ _progress_end(void *data, PM_Project_Result result, Eina_List *widgets) elm_entry_entry_set(tab_new.meta.comment, N_("Created with Eflete!")); _checks_set(false); } - _tabs_progress_end(data, result, widgets); + _tabs_progress_end(data, result); } static Eina_Bool diff --git a/src/bin/ui/tabs_private.h b/src/bin/ui/tabs_private.h index 2c55912..a717d41 100644 --- a/src/bin/ui/tabs_private.h +++ b/src/bin/ui/tabs_private.h @@ -77,7 +77,7 @@ Eina_Bool entry_path_set(void *data, Evas_Object *obj, void *event_info); void -_tabs_progress_end(void *data, PM_Project_Result result, Eina_List *widgets); +_tabs_progress_end(void *data, PM_Project_Result result); void _tab_default_focus(void *data, Evas *e, Evas_Object *obj, void *event_info); --