hmmm small update to previous commit which preserves functionality of related efm API call while still providing fix for icon cache update event

SVN revision: 83686
This commit is contained in:
Mike Blumenkrantz 2013-02-06 15:02:27 +00:00
parent 714611a0da
commit 16e1ac105e
1 changed files with 18 additions and 7 deletions

View File

@ -1613,16 +1613,14 @@ e_fm2_window_object_set(Evas_Object *obj, E_Object *eobj)
e_drop_handler_xds_set(sd->drop_handler, _e_fm2_cb_dnd_drop);
}
EAPI void
e_fm2_icons_update(Evas_Object *obj)
static void
_e_fm2_icons_update_helper(E_Fm2_Smart_Data *sd, Eina_Bool icon_only)
{
Eina_List *l;
E_Fm2_Icon *ic;
char buf[PATH_MAX], *pfile;
int bufused, buffree;
EFM_SMART_CHECK();
if ((!sd->realpath) || (!sd->icons)) return;
bufused = eina_strlcpy(buf, sd->realpath, sizeof(buf));
if (bufused >= (int)(sizeof(buf) - 2))
@ -1661,15 +1659,28 @@ e_fm2_icons_update(Evas_Object *obj)
}
}
if (ic->realized)
if (!ic->realized) continue;
if (icon_only)
{
E_FN_DEL(evas_object_del, ic->obj_icon);
_e_fm2_icon_icon_set(ic);
}
else
{
_e_fm2_icon_unrealize(ic);
_e_fm2_icon_realize(ic);
}
}
e_fm2_custom_file_flush();
}
EAPI void
e_fm2_icons_update(Evas_Object *obj)
{
EFM_SMART_CHECK();
_e_fm2_icons_update_helper(sd, EINA_FALSE);
}
EAPI void
e_fm2_pan_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
{
@ -1990,7 +2001,7 @@ _e_fm2_icon_thumb_edje_get(Evas *evas, const E_Fm2_Icon *ic, Evas_Smart_Cb cb, v
static Eina_Bool
_e_fm2_icon_cache_update(void *data, int type __UNUSED__, void *event __UNUSED__)
{
e_fm2_icons_update(data);
_e_fm2_icons_update_helper(data, EINA_TRUE);
return ECORE_CALLBACK_RENEW;
}
@ -8383,7 +8394,7 @@ _e_fm2_smart_add(Evas_Object *obj)
evas_object_resize(obj, 0, 0);
E_LIST_HANDLER_APPEND(sd->handlers, E_EVENT_CONFIG_ICON_THEME, _e_fm2_cb_theme, sd->obj);
E_LIST_HANDLER_APPEND(sd->handlers, EFREET_EVENT_ICON_CACHE_UPDATE, _e_fm2_icon_cache_update, sd->obj);
E_LIST_HANDLER_APPEND(sd->handlers, EFREET_EVENT_ICON_CACHE_UPDATE, _e_fm2_icon_cache_update, sd);
_e_fm2_list = eina_list_append(_e_fm2_list, sd->obj);
}