rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=059c56e20af3fa25d0887426912b66e64ee89e2e

commit 059c56e20af3fa25d0887426912b66e64ee89e2e
Author: Vitalii Vorobiov <vi.vorob...@samsung.com>
Date:   Tue Sep 20 16:05:40 2016 +0300

    editor_program: use different signal to delete program for eflete
    
    1. delete program from eflete
    2. only then delete from project and edj file directly
    
    @fix
---
 src/bin/common/signals.h        |  1 +
 src/bin/editor/editor_program.c | 10 +++++++++-
 src/bin/ui/tabs.c               |  8 ++++----
 3 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/src/bin/common/signals.h b/src/bin/common/signals.h
index cb54893..bba7351 100644
--- a/src/bin/common/signals.h
+++ b/src/bin/common/signals.h
@@ -455,6 +455,7 @@ typedef struct {
    const char *program_name;
    Change *change;
 } Editor_Program;
+#define SIGNAL_EDITOR_PROGRAM_PREDELETED "SIGNAL_EDITOR_PROGRAM_PREDELETED"
 #define SIGNAL_EDITOR_PROGRAM_DELETED "SIGNAL_EDITOR_PROGRAM_DELETED"
 
 /**
diff --git a/src/bin/editor/editor_program.c b/src/bin/editor/editor_program.c
index e663ec2..ab1109e 100644
--- a/src/bin/editor/editor_program.c
+++ b/src/bin/editor/editor_program.c
@@ -911,7 +911,15 @@ _editor_program_del(Evas_Object *edit_object, Change 
*change, Eina_Bool merge __
 
    event_info.program_name = eina_stringshare_add(program_name);
    event_info.change = change;
-   if (!_editor_signals_blocked) evas_object_smart_callback_call(ap.win, 
SIGNAL_EDITOR_PROGRAM_DELETED, (void *)&event_info);
+   if (!_editor_signals_blocked)
+     {
+        /* so in here we need to delete program from workspace, groupedit,
+           all kind of UI part lists since they use original Resource 
structure,
+           and only after that we can finally delete it,
+           so keep those signals in this order please */
+        evas_object_smart_callback_call(ap.win, 
SIGNAL_EDITOR_PROGRAM_PREDELETED, (void *)&event_info);
+        evas_object_smart_callback_call(ap.win, SIGNAL_EDITOR_PROGRAM_DELETED, 
(void *)&event_info);
+     }
 
    if (change)
      {
diff --git a/src/bin/ui/tabs.c b/src/bin/ui/tabs.c
index bbb8495..e950491 100644
--- a/src/bin/ui/tabs.c
+++ b/src/bin/ui/tabs.c
@@ -539,13 +539,13 @@ _editor_program_deleted_cb(void *data __UNUSED__,
                            Evas_Object *obj __UNUSED__,
                            void *event_info)
 {
-   Eina_Stringshare *program_name = event_info;
+   Editor_Program *program = (Editor_Program *)event_info;
 
-   assert(program_name != NULL);
+   assert(program != NULL);
    assert(tabs.current_group != NULL);
    assert(tabs.current_workspace != NULL);
 
-   workspace_program_del(tabs.current_workspace, program_name);
+   workspace_program_del(tabs.current_workspace, program->program_name);
 }
 
 static void
@@ -1027,7 +1027,7 @@ tabs_add(void)
    evas_object_smart_callback_add(ap.win, SIGNAL_EDITOR_STATE_ADDED, 
_editor_state_added_cb, NULL);
    evas_object_smart_callback_add(ap.win, SIGNAL_EDITOR_STATE_PREDELETED, 
_editor_state_deleted_cb, NULL);
    evas_object_smart_callback_add(ap.win, SIGNAL_EDITOR_PROGRAM_ADDED, 
_editor_program_added_cb, NULL);
-   evas_object_smart_callback_add(ap.win, SIGNAL_EDITOR_PROGRAM_DELETED, 
_editor_program_deleted_cb, NULL);
+   evas_object_smart_callback_add(ap.win, SIGNAL_EDITOR_PROGRAM_PREDELETED, 
_editor_program_deleted_cb, NULL);
    evas_object_smart_callback_add(ap.win, SIGNAL_EDITOR_GROUP_DATA_ADDED, 
_editor_group_data_added_cb, NULL);
    evas_object_smart_callback_add(ap.win, SIGNAL_EDITOR_GROUP_DATA_DELETED, 
_editor_group_data_deleted_cb, NULL);
 

-- 


Reply via email to