yakov pushed a commit to branch master.

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

commit 36a4f73e5eb65ecdf72e3295092f01e89c8915cc
Author: Yakov Goldberg <yako...@samsung.com>
Date:   Mon Nov 23 13:58:14 2015 +0200

    Add eid_name_get_internal() API
    
    eid_name_get() returns eid name only if eid is active.
    This API will return eid_name even if eid is not active.
---
 src/lib/gui_widget.c | 14 ++++++++++++++
 src/lib/gui_widget.h |  3 +++
 src/lib/undoredo.c   |  8 ++++----
 3 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/src/lib/gui_widget.c b/src/lib/gui_widget.c
index 271ae08..326a9b4 100644
--- a/src/lib/gui_widget.c
+++ b/src/lib/gui_widget.c
@@ -809,6 +809,20 @@ eid_del(Eid *eid)
 }
 
 const char *
+eid_name_get_internal(Eid *eid)
+{
+   if (!IS_ID_VALID(eid)) return NULL;
+
+   Eid_Data *eid_data = _eid_data_get(eid);
+   if (eid_data == NULL)
+     {
+        ERR("Resource doesn't exist already. Put here breakpoint and debug.");
+        return NULL;
+     }
+   return eid_data->name;
+}
+
+const char *
 eid_name_get(Eid *eid)
 {
    if (!IS_ID_VALID(eid)) return NULL;
diff --git a/src/lib/gui_widget.h b/src/lib/gui_widget.h
index e224adb..20c5fa5 100644
--- a/src/lib/gui_widget.h
+++ b/src/lib/gui_widget.h
@@ -191,6 +191,9 @@ eid_exists(Eid *eid);
 const char *
 eid_name_get(Eid *eid);
 
+const char *
+eid_name_get_internal(Eid *eid);
+
 void
 eid_active_set(Eid *eid, Eina_Bool state);
 
diff --git a/src/lib/undoredo.c b/src/lib/undoredo.c
index 2d45c87..22bddf2 100644
--- a/src/lib/undoredo.c
+++ b/src/lib/undoredo.c
@@ -322,7 +322,7 @@ memento_finalize(Memento *memento)
                     {
                        undo_debug("Merging %s on %s: %p -> %p -> %p",
                              _memento_type_get_as_string(cmd->type),
-                             eid_name_get(cmd->eid), cmd->old_ptr, 
cmd->new_ptr,
+                             eid_name_get_internal(cmd->eid), cmd->old_ptr, 
cmd->new_ptr,
                              cmd_next->new_ptr);
                        /* Swap pointers in order to properly unref data. */
                        void *tmp = cmd->new_ptr;
@@ -339,7 +339,7 @@ memento_finalize(Memento *memento)
                {
                   undo_debug("Deleting %s on %s: %p -> %p",
                         _memento_type_get_as_string(cmd->type),
-                        eid_name_get(cmd->eid), cmd->old_ptr, cmd->new_ptr);
+                        eid_name_get_internal(cmd->eid), cmd->old_ptr, 
cmd->new_ptr);
                   cmd_del = EINA_TRUE;
                   break;
                }
@@ -368,7 +368,7 @@ memento_finalize(Memento *memento)
                     {
                        undo_debug("Deleting %s on %s: %p -> %p",
                              _memento_type_get_as_string(cmd->type),
-                             eid_name_get(cmd->eid), cmd->old_ptr, 
cmd->new_ptr);
+                             eid_name_get_internal(cmd->eid), cmd->old_ptr, 
cmd->new_ptr);
                        break;
                     }
                }
@@ -585,7 +585,7 @@ context_undo_redo_apply(const Gui_Context *ctx, Eina_Bool 
memento_redo)
         undo_debug("%s : %s on %s: %p -> %p",
                    memento_redo ? "Redo" : "Undo",
                    _memento_type_get_as_string(cmd->type),
-                   eid_name_get(cmd->eid), from, to);
+                   eid_name_get_internal(cmd->eid), from, to);
 
         switch (type)
           {

-- 


Reply via email to