rimmed pushed a commit to branch master. http://git.enlightenment.org/tools/eflete.git/commit/?id=39c3aebb6882f799afc01099ea56cc114bdc91ee
commit 39c3aebb6882f799afc01099ea56cc114bdc91ee Author: Vitalii Vorobiov <vi.vorob...@samsung.com> Date: Tue Sep 20 14:04:09 2016 +0300 resource_manager_react: use different signals for group_data rename @fix --- src/bin/editor/editor_group.c | 14 +++++++++++--- src/bin/resource_manager/resource_manager_react.c | 23 ++++++----------------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/src/bin/editor/editor_group.c b/src/bin/editor/editor_group.c index d14e4cf..0e670e6 100644 --- a/src/bin/editor/editor_group.c +++ b/src/bin/editor/editor_group.c @@ -287,10 +287,13 @@ editor_group_data_name_set(Evas_Object *edit_object, Change *change, Eina_Bool m Diff *diff; Rename ren; Editor_Attribute_Change send; - send.attribute = RM_ATTRIBUTE_GROUP_DATA_NAME; assert(edit_object != NULL); assert(item_name != NULL); assert(new_val != NULL); + + send.attribute = RM_ATTRIBUTE_GROUP_DATA_NAME; + send.old_value = eina_stringshare_add(item_name); + send.value = eina_stringshare_add(new_val); if (change) { diff = mem_calloc(1, sizeof(Diff)); @@ -313,9 +316,14 @@ editor_group_data_name_set(Evas_Object *edit_object, Change *change, Eina_Bool m _editor_project_changed(); ren.old_name = item_name; ren.new_name = new_val; - if (!_editor_signals_blocked) evas_object_smart_callback_call(ap.win, SIGNAL_GROUP_DATA_RENAMED, &ren); - if (!_editor_signals_blocked) evas_object_smart_callback_call(ap.win, SIGNAL_EDITOR_RM_ATTRIBUTE_CHANGED, &send); + if (!_editor_signals_blocked) + { + evas_object_smart_callback_call(ap.win, SIGNAL_GROUP_DATA_RENAMED, &ren); + evas_object_smart_callback_call(ap.win, SIGNAL_EDITOR_RM_ATTRIBUTE_CHANGED, &send); + } } + eina_stringshare_del(send.old_value); + eina_stringshare_del(send.value); return true; } diff --git a/src/bin/resource_manager/resource_manager_react.c b/src/bin/resource_manager/resource_manager_react.c index fcec450..84c4fa4 100644 --- a/src/bin/resource_manager/resource_manager_react.c +++ b/src/bin/resource_manager/resource_manager_react.c @@ -109,7 +109,7 @@ _property_attribute_changed(void *data, ** > expand editor (top blocks like image, sound, etc) not supported ** *********************************************************************** ***********************************************************************/ - Resource2 *part, *state, *source, *old_source, *item, *program; + Resource2 *part, *state, *source, *old_source, *item, *program, *group_data; Editor_Attribute_Change *change = (Editor_Attribute_Change *)event_info; Attribute editor_resource = (int)change->attribute; @@ -484,6 +484,11 @@ _property_attribute_changed(void *data, eina_stringshare_del(part->common.name); part->common.name = eina_stringshare_add(change->value); break; + case RM_ATTRIBUTE_GROUP_DATA_NAME: + group_data = resource_manager_find(group->data_items, change->old_value); + eina_stringshare_del(group_data->common.name); + group_data->common.name = eina_stringshare_add(change->value); + break; default: break; } @@ -682,20 +687,6 @@ _style_changed(void *data, } static void -_group_data_renamed(void *data __UNUSED__, - Evas_Object *obj __UNUSED__, - void *ei) -{ - Rename *ren = ei; - Group_Data2 *group_data; - - Group2 *group = tabs_current_group_get(); - group_data = (Group_Data2 *)resource_manager_find(group->data_items, ren->old_name); - - eina_stringshare_del(group_data->common.name); - group_data->common.name = eina_stringshare_add(ren->new_name); -} -static void _editor_part_added_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info) @@ -931,7 +922,6 @@ _resource_callbacks_register(Project *project) evas_object_smart_callback_add(ap.win, SIGNAL_EDITOR_STYLE_TAG_CHANGED, _style_changed, project); /* already implemented stack of editor changes */ - evas_object_smart_callback_add(ap.win, SIGNAL_GROUP_DATA_RENAMED, _group_data_renamed, project); evas_object_smart_callback_add(ap.win, SIGNAL_EDITOR_PART_ADDED, _editor_part_added_cb, project); evas_object_smart_callback_add(ap.win, SIGNAL_EDITOR_PART_DELETED, _editor_part_deleted_cb, project); evas_object_smart_callback_add(ap.win, SIGNAL_EDITOR_PART_RESTACKED, _editor_part_restacked_cb, project); @@ -967,7 +957,6 @@ _resource_callbacks_unregister(Project *project) evas_object_smart_callback_del_full(ap.win, SIGNAL_EDITOR_STYLE_TAG_CHANGED, _style_changed, project); /* already implemented stack of editor changes */ - evas_object_smart_callback_del_full(ap.win, SIGNAL_GROUP_DATA_RENAMED, _group_data_renamed, project); evas_object_smart_callback_del_full(ap.win, SIGNAL_EDITOR_PART_ADDED, _editor_part_added_cb, project); evas_object_smart_callback_del_full(ap.win, SIGNAL_EDITOR_PART_DELETED, _editor_part_deleted_cb, project); evas_object_smart_callback_del_full(ap.win, SIGNAL_EDITOR_PART_RESTACKED, _editor_part_restacked_cb, project); --