yakov pushed a commit to branch master.

http://git.enlightenment.org/tools/erigo.git/commit/?id=a73bc46aba65df13d0a566615d2a55b049c11643

commit a73bc46aba65df13d0a566615d2a55b049c11643
Author: Yakov Goldberg <yako...@samsung.com>
Date:   Wed Nov 25 16:27:05 2015 +0200

    Fix: add missing memento and reorder in proper order
    
    Parent memento for object was missing.
    Reorder mementos, because order matters for updater.
---
 src/bin/gui/editor.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/bin/gui/editor.c b/src/bin/gui/editor.c
index a91b231..fc97e8c 100644
--- a/src/bin/gui/editor.c
+++ b/src/bin/gui/editor.c
@@ -3616,8 +3616,9 @@ _field_update_from_itemview(void *data EINA_UNUSED, Eo 
*obj, const Eo_Event_Desc
    /* Assign property to item, old property will be unref()ed. */
    item_container_item_prop_set(new_wit, new_prop);
 
-   /* Create memento. */
-   memento_command_add(wdg_eid_get(wdg), MEMENTO_ITEM_CONTAINER_ITEM, (void *) 
wit, new_wit);
+   /* Here we need to create memento, but this memento should be last.
+    * So ref prev item. */
+   item_container_item_ref(wit);
 
    /* Change item in Dep_Data*/
    item_container_item_set_on_id(item_container_item_eid_get(wit), new_wit);
@@ -3695,6 +3696,7 @@ _field_update_from_itemview(void *data EINA_UNUSED, Eo 
*obj, const Eo_Event_Desc
                        manager_widget_content_unset(session, 
prev_wdg_container, old_container_name, old_prop, NULL);
                        wdg_obj_container_item_remove(prev_wdg_container, _ci);
                     }
+                  memento_command_add(wdg_eid_get(w), MEMENTO_WIDGET_PARENT, 
wdg_eid_get(wdg_parent_get(w)), wdg_eid_get(wdg));
                   wdg_parent_set(w, wdg_name_get(wdg));
                   wdg_parent_container_eid_set(w, wdg_eid_get(wdg));
                }
@@ -3712,6 +3714,9 @@ _field_update_from_itemview(void *data EINA_UNUSED, Eo 
*obj, const Eo_Event_Desc
           }
         objtree_item_selected_set(wdg);
      }
+   /* Create memento and unref prev item*/
+   memento_command_add(wdg_eid_get(wdg), MEMENTO_ITEM_CONTAINER_ITEM, (void *) 
wit, new_wit);
+   item_container_item_unref(wit);
    context_memento_finalize(_active_context_get());
    return EO_CALLBACK_CONTINUE;
 }

-- 


Reply via email to