raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=5e09d1307ba29ba893c569978e808d61f9ae09c9

commit 5e09d1307ba29ba893c569978e808d61f9ae09c9
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Thu Apr 21 18:01:00 2016 +0900

    eo base - remove the duplicated key dels and just do eo_key_del() now
    
    this rationalizes all the duplicated key dels (key_data, key_obj and
    key_value).
---
 src/bindings/eo_cxx/eo_ops.hh        |  2 +-
 src/bindings/luajit/eo.lua           |  2 +-
 src/lib/elementary/efl_ui_grid.c     |  2 +-
 src/lib/elementary/elm_cnp.c         |  2 +-
 src/lib/eo/eo_base.eo                | 14 +---------
 src/lib/eo/eo_base_class.c           | 52 +-----------------------------------
 src/lib/evas/canvas/evas_data.c      |  2 +-
 src/tests/eo/suite/eo_test_general.c |  7 ++---
 8 files changed, 11 insertions(+), 72 deletions(-)

diff --git a/src/bindings/eo_cxx/eo_ops.hh b/src/bindings/eo_cxx/eo_ops.hh
index f2d5133..3629e77 100644
--- a/src/bindings/eo_cxx/eo_ops.hh
+++ b/src/bindings/eo_cxx/eo_ops.hh
@@ -87,7 +87,7 @@ base_data_get(const Eo *obj, const char *key)
 inline void
 base_data_del(Eo *obj, const char *key)
 {
-   eo_key_data_del(obj, key);
+   eo_key_del(obj, key);
 }
 
 inline void
diff --git a/src/bindings/luajit/eo.lua b/src/bindings/luajit/eo.lua
index 6f7bd16..0419f82 100644
--- a/src/bindings/luajit/eo.lua
+++ b/src/bindings/luajit/eo.lua
@@ -101,7 +101,7 @@ ffi.cdef [[
     void eo_key_data_set(const char *key, const void *data,
         eo_key_data_free_func free_func);
     void *eo_key_data_get(const char *key);
-    void  eo_key_data_del(const char *key);
+    void  eo_key_del(const char *key);
 
     Eina_Iterator *eo_children_iterator_new(void);
 
diff --git a/src/lib/elementary/efl_ui_grid.c b/src/lib/elementary/efl_ui_grid.c
index 1a43e32..f0af2ff 100644
--- a/src/lib/elementary/efl_ui_grid.c
+++ b/src/lib/elementary/efl_ui_grid.c
@@ -590,7 +590,7 @@ end:
    pd->items = (Grid_Item *)
          eina_inlist_remove(EINA_INLIST_GET(pd->items), EINA_INLIST_GET(gi));
    pd->count--;
-   eo_key_data_del(subobj, GRID_ITEM_KEY);
+   eo_key_del(subobj, GRID_ITEM_KEY);
    free(gi);
 }
 
diff --git a/src/lib/elementary/elm_cnp.c b/src/lib/elementary/elm_cnp.c
index 06fa1f0..e62912a 100644
--- a/src/lib/elementary/elm_cnp.c
+++ b/src/lib/elementary/elm_cnp.c
@@ -3913,7 +3913,7 @@ _local_elm_drop_target_del(Evas_Object *obj, 
Elm_Sel_Format format,
         if (!dropable->cbs_list)
           {
              drops = eina_list_remove(drops, dropable);
-             eo_key_data_del(obj, "__elm_dropable");
+             eo_key_del(obj, "__elm_dropable");
              free(dropable);
              dropable = NULL;
              evas_object_event_callback_del(obj, EVAS_CALLBACK_DEL,
diff --git a/src/lib/eo/eo_base.eo b/src/lib/eo/eo_base.eo
index d1fc1ab..19c50eb 100644
--- a/src/lib/eo/eo_base.eo
+++ b/src/lib/eo/eo_base.eo
@@ -221,7 +221,7 @@ abstract Eo.Base ()
          }
          return: void *; [[the data for the key]]
       }
-      key_data_del {
+      key_del {
          [[Del generic data from object.]]
          params {
             @in key: const(char)*; [[the key associated with the data]]
@@ -250,12 +250,6 @@ abstract Eo.Base ()
          }
          return: Eo.Base *; [[the object reference for the key]]
       }
-      key_obj_del {
-         [[Del generic objecrt reference from object.]]
-         params {
-            @in key: const(char)*; [[the key associated with the object ref]]
-         }
-      }
       key_value_set {
          [[Set value on the object.
 
@@ -278,12 +272,6 @@ abstract Eo.Base ()
          }
          return: Eina.Value *; [[the value for the key]]
       }
-      key_value_del {
-         [[Del generic value from object.]]
-         params {
-            @in key: const(char)*; [[the key associated with the value]]
-         }
-      }
       event_thaw {
          [[thaw events of object.
 
diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index f81e54e..a525886 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -188,7 +188,7 @@ _eo_base_key_data_get(const Eo *obj, Eo_Base_Data *pd, 
const char *key)
 }
 
 EOLIAN static void
-_eo_base_key_data_del(Eo *obj, Eo_Base_Data *pd, const char *key)
+_eo_base_key_del(Eo *obj, Eo_Base_Data *pd, const char *key)
 {
    Eo_Generic_Data_Node *node;
 
@@ -277,31 +277,6 @@ _eo_base_key_obj_get(const Eo *obj, Eo_Base_Data *pd, 
const char *key)
 }
 
 EOLIAN static void
-_eo_base_key_obj_del(Eo *obj EINA_UNUSED, Eo_Base_Data *pd, const char *key)
-{
-   Eo_Generic_Data_Node *node;
-
-   if (!key) return;
-   EINA_INLIST_FOREACH(pd->generic_data, node)
-     {
-        if (!strcmp(node->key, key))
-          {
-             pd->generic_data = eina_inlist_remove(pd->generic_data,
-                                                   EINA_INLIST_GET(node));
-             if (node->data_is_obj)
-               {
-                  eo_event_callback_del(node->data, EO_BASE_EVENT_DEL,
-                                        _eo_base_cb_key_obj_del, obj);
-                  eo_unref(node->data);
-               }
-             else if (node->data_is_value) eina_value_free(node->data);
-             _eo_generic_data_node_free(node);
-             return;
-          }
-     }
-}
-
-EOLIAN static void
 _eo_base_key_value_set(Eo *obj, Eo_Base_Data *pd, const char *key, Eina_Value 
*value)
 {
    Eo_Generic_Data_Node *node;
@@ -365,31 +340,6 @@ _eo_base_key_value_get(const Eo *obj, Eo_Base_Data *pd, 
const char *key)
 }
 
 EOLIAN static void
-_eo_base_key_value_del(Eo *obj EINA_UNUSED, Eo_Base_Data *pd, const char *key)
-{
-   Eo_Generic_Data_Node *node;
-
-   if (!key) return;
-   EINA_INLIST_FOREACH(pd->generic_data, node)
-     {
-        if (!strcmp(node->key, key))
-          {
-             pd->generic_data = eina_inlist_remove(pd->generic_data,
-                                                   EINA_INLIST_GET(node));
-             if (node->data_is_obj)
-               {
-                  eo_event_callback_del(node->data, EO_BASE_EVENT_DEL,
-                                        _eo_base_cb_key_obj_del, obj);
-                  eo_unref(node->data);
-               }
-             else if (node->data_is_value) eina_value_free(node->data);
-             _eo_generic_data_node_free(node);
-             return;
-          }
-     }
-}
-
-EOLIAN static void
 _eo_base_id_set(Eo *obj EINA_UNUSED, Eo_Base_Data *pd, const char *id)
 {
    if ((id) && (!id[0])) id = NULL;
diff --git a/src/lib/evas/canvas/evas_data.c b/src/lib/evas/canvas/evas_data.c
index e991e06..ba4e113 100644
--- a/src/lib/evas/canvas/evas_data.c
+++ b/src/lib/evas/canvas/evas_data.c
@@ -30,6 +30,6 @@ evas_object_data_del(Evas_Object *obj, const char *key)
    MAGIC_CHECK_END();
    void *data = NULL;
    data = eo_key_data_get(obj, key);
-   eo_key_data_del(obj, key);
+   eo_key_del(obj, key);
    return data;
 }
diff --git a/src/tests/eo/suite/eo_test_general.c 
b/src/tests/eo/suite/eo_test_general.c
index 2980c19..a6444ee 100644
--- a/src/tests/eo/suite/eo_test_general.c
+++ b/src/tests/eo/suite/eo_test_general.c
@@ -608,7 +608,7 @@ START_TEST(eo_generic_data)
    eo_key_data_set(obj, "test1", (void *) 1);
    data = eo_key_data_get(obj, "test1");
    fail_if(1 != (intptr_t) data);
-   eo_key_data_del(obj, "test1");
+   eo_key_del(obj, "test1");
    data = eo_key_data_get(obj, "test1");
    fail_if(data);
 
@@ -621,13 +621,13 @@ START_TEST(eo_generic_data)
 
    data = eo_key_data_get(obj, "test2");
    fail_if(2 != (intptr_t) data);
-   eo_key_data_del(obj, "test2");
+   eo_key_del(obj, "test2");
    data = eo_key_data_get(obj, "test2");
    fail_if(data);
 
    data = eo_key_data_get(obj, "test1");
    fail_if(1 != (intptr_t) data);
-   eo_key_data_del(obj, "test1");
+   eo_key_del(obj, "test1");
    data = eo_key_data_get(obj, "test1");
    fail_if(data);
 
@@ -671,6 +671,7 @@ START_TEST(eo_generic_data)
    eo_key_value_del(obj, "value1");
    value2 = eo_key_value_get(obj, "value1");
    fail_if(value2 != NULL);
+   eo_key_del(obj, "value1");
 
    eo_unref(obj);
    eo_unref(obj2);

-- 


Reply via email to