seoz pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=6e9c218a9391a9d46a4791aafd7361479ca20b25

commit 6e9c218a9391a9d46a4791aafd7361479ca20b25
Author: SangHyeon Lee <[email protected]>
Date:   Sat Aug 23 01:52:53 2014 +0900

    gengrid/popup: Fix wrong return type of _item_del_pre_hook.
    
    Summary:
    elm_widget calls _item_del_pre_hook of each widget and widget can
    decide item deletion by return type. But gengrid and popup widget 
implemented
    those _item_del_pre_hook function as a void type.
    So this commit fixs the return types to Eina_Bool and changes gengrid 
widget to return EINA_FALSE when
    the item wants to be deleted later.
    And when the item wants to be deleted directly, it returns EINA_TRUE.
    
    @fix
    
    Test Plan: test in demo.
    
    Reviewers: seoz, raster, bluezery
    
    Subscribers: Hermet, jaehwan
    
    Differential Revision: https://phab.enlightenment.org/D872
---
 src/lib/elc_popup.c   | 3 ++-
 src/lib/elm_gengrid.c | 5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/lib/elc_popup.c b/src/lib/elc_popup.c
index d52dbd3..1de51e1 100644
--- a/src/lib/elc_popup.c
+++ b/src/lib/elc_popup.c
@@ -779,7 +779,7 @@ _item_disable_hook(Elm_Object_Item *item)
      elm_layout_signal_emit(VIEW(it), "elm,state,item,enabled", "elm");
 }
 
-static void
+static Eina_Bool
 _item_del_pre_hook(Elm_Object_Item *item)
 {
    Elm_Popup_Item *it = (Elm_Popup_Item *)item;
@@ -795,6 +795,7 @@ _item_del_pre_hook(Elm_Object_Item *item)
         sd->items = NULL;
         _list_del(sd);
      }
+   return EINA_TRUE;
 }
 
 static void
diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c
index f388063..9d195e7 100644
--- a/src/lib/elm_gengrid.c
+++ b/src/lib/elm_gengrid.c
@@ -3275,7 +3275,7 @@ _item_disable_hook(Elm_Object_Item *item)
      }
 }
 
-static void
+static Eina_Bool
 _item_del_pre_hook(Elm_Object_Item *item)
 {
    Elm_Gen_Item *it = (Elm_Gen_Item *)item;
@@ -3283,10 +3283,11 @@ _item_del_pre_hook(Elm_Object_Item *item)
    if (it->walking > 0)
      {
         _elm_gengrid_item_del_not_serious(it);
-        return;
+        return EINA_FALSE;
      }
 
    _item_del(it);
+   return EINA_TRUE;
 }
 
 static Evas_Object *

-- 


Reply via email to