fix efm mime actions to properly add a separator if there is an action which fails a test before an action that does not fail a test

SVN revision: 75764
This commit is contained in:
Mike Blumenkrantz 2012-08-28 08:30:16 +00:00
parent c94ce38fa4
commit 098e8723e0
1 changed files with 5 additions and 3 deletions

View File

@ -8495,6 +8495,7 @@ _e_fm2_context_menu_append(Evas_Object *obj, const char *path, Eina_List *l, E_M
{ {
E_Fm2_Mime_Handler *handler; E_Fm2_Mime_Handler *handler;
const Eina_List *ll; const Eina_List *ll;
Eina_Bool added = EINA_FALSE;
if (!l) return; if (!l) return;
@ -8505,15 +8506,16 @@ _e_fm2_context_menu_append(Evas_Object *obj, const char *path, Eina_List *l, E_M
E_Fm2_Context_Menu_Data *md = NULL; E_Fm2_Context_Menu_Data *md = NULL;
E_Menu_Item *mi; E_Menu_Item *mi;
if ((!handler) || (!e_fm2_mime_handler_test(handler, obj, path)) || if ((!handler) || (!handler->label) || (!e_fm2_mime_handler_test(handler, obj, path)))
(!handler->label)) continue; continue;
if (ll == l) if (!added)
{ {
/* only append the separator if this is the first item */ /* only append the separator if this is the first item */
/* we do this in here because we dont want to add a separator /* we do this in here because we dont want to add a separator
* when we have no context entries */ * when we have no context entries */
mi = e_menu_item_new(mn); mi = e_menu_item_new(mn);
e_menu_item_separator_set(mi, 1); e_menu_item_separator_set(mi, 1);
added = EINA_TRUE;
} }
md = E_NEW(E_Fm2_Context_Menu_Data, 1); md = E_NEW(E_Fm2_Context_Menu_Data, 1);