All pastes #736420 Raw Edit

Stuff

public text v1 · immutable
·published 2007-10-14 14:54 UTC
rendered paste body
	if (ic->info.mime) 
	  {
	     /* see if we have any mime handlers registered for this file */
	     l = e_fm_mime_handler_mime_handlers_get(ic->info.mime);
             _e_fm_context_menu_append(l, mn);
	  }	
	  
        /* see if we have any glob handlers registered for this file */
        snprintf(buf, sizeof(buf), "*.%s", strrchr(ic->info.file, '.'));
        l = e_fm_mime_handler_glob_handlers_get(buf);
        _e_fm_context_menu_append(l, mn);
	 
static inline void
_e_fm_context_menu_append(Evas_List *l, E_Menu *mn)
{
	if (l) 
	  {
	     Evas_List *ll = NULL;
	     
	     mi = e_menu_item_new(mn);
	     e_menu_item_separator_set(mi, 1);
	     
	     for (ll = l; ll; ll = ll->next) 
	       {
		  E_Fm_Mime_Handler *handler = NULL;
		  E_Fm2_Context_Menu_Data *md = NULL;
		  
		  handler = ll->data;
		  if (!handler) continue;
		  md = E_NEW(E_Fm2_Context_Menu_Data, 1);
		  if (!md) continue;
		  md->icon = ic;
		  md->handler = handler;
		  mi = e_menu_item_new(mn);
		  e_menu_item_label_set(mi, handler->label);
		  /* TODO: Add Icon */
		  e_menu_item_callback_set(mi, _e_fm2_icon_menu_item_cb, md);
	       }
	  }
}