yakov pushed a commit to branch master.

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

commit 4e67e267cba0852240ee5c29d8c0ebaa7cbfdb61
Author: Yakov Goldberg <yako...@samsung.com>
Date:   Sun Nov 8 13:02:46 2015 +0200

    Add support for property mementos squashing
---
 src/lib/undoredo.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/lib/undoredo.c b/src/lib/undoredo.c
index 9b53184..8563693 100644
--- a/src/lib/undoredo.c
+++ b/src/lib/undoredo.c
@@ -332,6 +332,22 @@ memento_finalize(Memento *memento)
                     }
 
                }
+             if (cmd->type == MEMENTO_PROPERTY)
+               {
+                  if (!prop_cmp(cmd->old_ptr, cmd->new_ptr))
+                    {
+                       cmd->delete_me = EINA_TRUE;
+                       /* To the moment of gui_context_finalize(), new 
property already is set in wdg.
+                        * Undo/redo works by adding/removing property pointer 
in wdg.
+                        * So if memento will be deleted, we will not be able 
to remove property from widgetŠ±
+                        * despite of property values are same, pointer is 
different.
+                        * This can be fixed when property will use Eid.
+                        * */
+                       Gui_Widget *wdg = wdg_get(cmd->eid);
+                       wdg_prop_remove(wdg, cmd->new_ptr);
+                       wdg_prop_add(wdg, cmd->old_ptr);
+                    }
+               }
           }
         EINA_LIST_FOREACH_SAFE(memento->cmds, itr, itr2, cmd)
           {

-- 


Reply via email to