From: Mike Blumenkrantz Date: Mon, 3 Oct 2011 02:25:30 +0000 (+0000) Subject: fix fixme in elm_toolbar_item_menu_get: no longer modifies a toolbar item X-Git-Tag: v1.0.0~1983 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=74ff42d260214e9a107e129d2148c717ed8cf7cd;p=platform%2Fupstream%2Felementary.git fix fixme in elm_toolbar_item_menu_get: no longer modifies a toolbar item SVN revision: 63756 --- diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in index 2653a9e..d37dc4d 100644 --- a/src/lib/Elementary.h.in +++ b/src/lib/Elementary.h.in @@ -14847,7 +14847,7 @@ extern "C" { * * @ingroup Toolbar */ - EAPI Evas_Object *elm_toolbar_item_menu_get(Elm_Toolbar_Item *item) EINA_ARG_NONNULL(1); + EAPI Evas_Object *elm_toolbar_item_menu_get(const Elm_Toolbar_Item *item) EINA_ARG_NONNULL(1); /** * Add a new state to @p item. diff --git a/src/lib/elm_toolbar.c b/src/lib/elm_toolbar.c index 5feae35..8f9e524 100644 --- a/src/lib/elm_toolbar.c +++ b/src/lib/elm_toolbar.c @@ -1755,14 +1755,11 @@ elm_toolbar_item_cursor_engine_only_get(const Elm_Toolbar_Item *item) } EAPI Evas_Object * -elm_toolbar_item_menu_get(Elm_Toolbar_Item *item) +elm_toolbar_item_menu_get(const Elm_Toolbar_Item *item) { ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); Widget_Data *wd = elm_widget_data_get(item->base.widget); - if (!wd) return NULL; - /* FIXME: It's not ok. This function needs to be reviewed. And should - * receive a const item */ - elm_toolbar_item_menu_set(item, 1); + if ((!wd) || (!item->menu)) return NULL; return item->o_menu; }