jpeg pushed a commit to branch master.

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

commit ad250d0ffb6718b87ce1ae539bcd6ab7eb813880
Author: Jean-Philippe Andre <[email protected]>
Date:   Wed Nov 30 17:12:43 2016 +0900

    menu: Fix crash in main menu and eo files
    
    This amends the previous commit to avoid a crash in the main
    menu, and adjust the eo files formatting.
---
 src/lib/efl/interfaces/efl_ui_item.eo | 28 ++++++++++++++++------------
 src/lib/efl/interfaces/efl_ui_menu.eo | 12 +++++++++---
 src/lib/elementary/elm_dbus_menu.c    | 10 +++++-----
 3 files changed, 30 insertions(+), 20 deletions(-)

diff --git a/src/lib/efl/interfaces/efl_ui_item.eo 
b/src/lib/efl/interfaces/efl_ui_item.eo
index 8b5710d..0ca8fbc 100644
--- a/src/lib/efl/interfaces/efl_ui_item.eo
+++ b/src/lib/efl/interfaces/efl_ui_item.eo
@@ -3,46 +3,50 @@ interface Efl.Ui.Item {
    methods {
       @property prev {
          get {
-            [[Get the item before $ it in the widget's internal list of
-              items.
+            [[Get the item before this one in the widget's list of items.
 
-              See also \@ref efl_ui_item_next_get.
+              See also @.next.
             ]]
          }
          values {
-              item: Efl.Ui.Item; [[The item before the object in its parent's 
list. If there is no previous item for $ it or there's an error, $null is 
returned.]]
+            item: Efl.Ui.Item; [[The item before the object in its parent's
+                                list. If there is no previous item or in case
+                                of error, $null is returned.]]
          }
       }
       @property next {
          get {
-            [[Get the item after $ it in the widget's
-              internal list of items.
+            [[Get the item after this one in the widget's list of items.
 
-              See also \@ref efl_ui_item_prev_get.
+              See also @.prev.
             ]]
          }
          values {
-              item: Efl.Ui.Item; [[The item after the object in its parent's 
list. If there is no previous item for $ it or there's an error, $null is 
returned.]]
+            item: Efl.Ui.Item; [[The item after the object in its parent's
+                                list. If there is no next item or in case
+                                of error, $null is returned.]]
          }
       }
       @property selected {
+         [[Indicates whether this item is currently selected.]]
          get {
-             [[Get the selected state of $item.]]
+            [[Get the selected state of this item.]]
          }
          set {
              [[Set the selected state of $item.
+
                This sets the selected state of the given item $it.
                $true for selected, $false for not selected.
 
                If a new item is selected the previously selected will
-               be unselected. Previously selected item can be get with
-               function @Efl.Ui.Menu.selected_item.get.
+               be unselected. Previously selected item can be retrieved
+               with @Efl.Ui.Menu.selected_item.get.
 
                Selected items will be highlighted.
              ]]
          }
          values {
-              selected: bool; [[The selection state.]]
+            selected: bool; [[The selection state.]]
          }
       }
    }
diff --git a/src/lib/efl/interfaces/efl_ui_menu.eo 
b/src/lib/efl/interfaces/efl_ui_menu.eo
index 3d61de1..1ebe083 100644
--- a/src/lib/efl/interfaces/efl_ui_menu.eo
+++ b/src/lib/efl/interfaces/efl_ui_menu.eo
@@ -4,19 +4,25 @@ interface Efl.Ui.Menu {
       @property selected_item {
          get {
             [[Get the selected item in the widget.]]
-            return: Efl.Ui.Item; [[The selected item or $null.]]
+         }
+         values {
+            item: Efl.Ui.Item; [[The selected item or $null.]]
          }
       }
       @property first_item {
          get {
             [[Get the first item in the widget.]]
-            return: Efl.Ui.Item;
+         }
+         values {
+            item: Efl.Ui.Item; [[The first item or $null.]]
          }
       }
       @property last_item {
          get {
             [[Get the last item in the widget.]]
-            return: Efl.Ui.Item;
+         }
+         values {
+            item: Efl.Ui.Item; [[The last item or $null.]]
          }
       }
       @property items {
diff --git a/src/lib/elementary/elm_dbus_menu.c 
b/src/lib/elementary/elm_dbus_menu.c
index 44f04ef..d649a24 100644
--- a/src/lib/elementary/elm_dbus_menu.c
+++ b/src/lib/elementary/elm_dbus_menu.c
@@ -423,9 +423,8 @@ static Elm_DBus_Menu *
 _elm_dbus_menu_add(Eo *menu)
 {
    Elm_DBus_Menu *dbus_menu;
-   const Eina_List *ret = NULL;
-   Eina_List *items, *l;
    Elm_Object_Item *obj_item;
+   Eina_Iterator *it = NULL;
 
    ELM_MENU_CHECK(menu) NULL;
 
@@ -445,9 +444,8 @@ _elm_dbus_menu_add(Eo *menu)
 
    dbus_menu->menu = menu;
 
-   ret = efl_ui_menu_items_get(menu);
-   items = (Eina_List *)ret;
-   EINA_LIST_FOREACH (items, l, obj_item)
+   it = efl_ui_menu_items_get(menu);
+   EINA_ITERATOR_FOREACH(it, obj_item)
      {
         ELM_MENU_ITEM_DATA_GET(obj_item, item);
         if (!_menu_add_recursive(dbus_menu, item))
@@ -456,10 +454,12 @@ _elm_dbus_menu_add(Eo *menu)
              goto error_hash;
           }
      }
+   eina_iterator_free(it);
 
    return dbus_menu;
 
 error_hash:
+   eina_iterator_free(it);
    eina_hash_free(dbus_menu->elements);
 error_menu:
    free(dbus_menu);

-- 


Reply via email to