From bf4c005ca286f7067f77a186e2b101b40dd98454 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 27 May 2010 09:01:41 +0000 Subject: [PATCH] kill off some unused variables, return values on some widtype check fails SVN revision: 49222 --- src/lib/elm_config.c | 2 +- src/lib/elm_hover.c | 4 ++-- src/lib/elm_index.c | 2 +- src/lib/elm_toolbar.c | 28 ++++++++++++++++++++-------- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c index 97a265d..bb112b8 100644 --- a/src/lib/elm_config.c +++ b/src/lib/elm_config.c @@ -364,7 +364,7 @@ _config_load(void) static void _env_get(void) { - char buf[PATH_MAX], *p, *s; + char *s; s = getenv("ELM_ENGINE"); if (s) diff --git a/src/lib/elm_hover.c b/src/lib/elm_hover.c index 2508aab..9e0d43c 100644 --- a/src/lib/elm_hover.c +++ b/src/lib/elm_hover.c @@ -399,7 +399,7 @@ elm_hover_target_get(Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; + if (!wd) return NULL; return wd->target; } @@ -417,7 +417,7 @@ elm_hover_parent_get(Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; + if (!wd) return NULL; return wd->parent; } diff --git a/src/lib/elm_index.c b/src/lib/elm_index.c index 6cd0ee2..31c1a1f 100644 --- a/src/lib/elm_index.c +++ b/src/lib/elm_index.c @@ -825,7 +825,7 @@ elm_index_item_del(Evas_Object *obj, const void *item) EAPI Elm_Index_Item * elm_index_item_find(Evas_Object *obj, const void *item) { - ELM_CHECK_WIDTYPE(obj, widtype); + ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; return _item_find(obj, item); diff --git a/src/lib/elm_toolbar.c b/src/lib/elm_toolbar.c index 10173f9..94763e7 100644 --- a/src/lib/elm_toolbar.c +++ b/src/lib/elm_toolbar.c @@ -659,10 +659,10 @@ elm_toolbar_scrollable_set(Evas_Object *obj, Eina_Bool scrollable) EAPI Eina_Bool elm_toolbar_scrollable_get(Evas_Object *obj) { - ELM_CHECK_WIDTYPE(obj, widtype); + ELM_CHECK_WIDTYPE(obj, widtype) 0; Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; + if (!wd) return 0; return wd->scrollable; } @@ -696,10 +696,10 @@ elm_toolbar_homogenous_set(Evas_Object *obj, Eina_Bool homogenous) EAPI Eina_Bool elm_toolbar_homogenous_get(Evas_Object *obj) { - ELM_CHECK_WIDTYPE(obj, widtype); + ELM_CHECK_WIDTYPE(obj, widtype) 0; Widget_Data *wd = elm_widget_data_get(obj); - if (!wd) return; + if (!wd) return 0; return wd->homogeneous; } @@ -774,6 +774,21 @@ elm_toolbar_item_unselect_all(Evas_Object *obj) } /** + * Unselect the specified toolbar item. + * + * @param item The toolbar item + * + * @ingroup Toolbar + */ +EAPI void +elm_toolbar_item_unselect(Elm_Toolbar_Item *item) +{ + if ((!item) || (!item->selected)) return; + item->selected = EINA_FALSE; + edje_object_signal_emit(item->base, "elm,state,unselected", "elm"); +} + +/** * Set the alignment of the items. * * @param obj The toolbar object @@ -874,8 +889,6 @@ elm_toolbar_item_menu_get(Elm_Toolbar_Item *item) EAPI Eina_List * elm_toolbar_item_get_all(Evas_Object *obj) { - Eina_List *l; - Elm_Toolbar_Item *it; ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; @@ -895,7 +908,6 @@ elm_toolbar_item_get_all(Evas_Object *obj) EAPI Elm_Toolbar_Item * elm_toolbar_item_get_first(Evas_Object *obj) { - Eina_List *l; Elm_Toolbar_Item *it; ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); @@ -917,7 +929,7 @@ elm_toolbar_item_get_first(Evas_Object *obj) EAPI Elm_Toolbar_Item * elm_toolbar_item_get_last(Evas_Object *obj) { - Eina_List *l, *last; + Eina_List *last; Elm_Toolbar_Item *it; ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); -- 2.7.4