static void
_list_free(Evry_Plugin *plugin)
{
- Evry_Item *it;
- EINA_LIST_FREE(plugin->items, it)
- evry_item_free(it);
}
static void
_cleanup(Evry_Plugin *plugin)
{
PLUGIN(p, plugin);
- /* Plugin *p = (Plugin*) plugin; */
Efreet_Desktop *desktop;
- _list_free(plugin);
+ EVRY_PLUGIN_ITEMS_FREE(p);
EINA_LIST_FREE(p->apps_mime, desktop)
efreet_desktop_free(desktop);
_fetch(Evry_Plugin *plugin, const char *input)
{
PLUGIN(p, plugin);
- /* Plugin *p = (Plugin*) plugin; */
Eina_List *l;
Efreet_Desktop *desktop;
+ Evry_Item *it;
char *file;
+ int prio = 0;
p->added = eina_hash_string_small_new(NULL);
- _list_free(plugin);
+ EVRY_PLUGIN_ITEMS_FREE(p);
/* add apps for a given mimetype */
if (plugin->type == type_action)
eina_hash_free(p->added);
- if (plugin->items)
- {
- int prio = 0;
- Evry_Item *it;
+ if (!plugin->items) return 0;
- l = plugin->items;
- plugin->items = eina_list_sort(l, eina_list_count(l), _cb_sort);
- EINA_LIST_FOREACH(plugin->items, l, it)
- it->priority = prio++;
+ EVRY_PLUGIN_ITEMS_SORT(plugin, _cb_sort);
- return 1;
- }
+ EINA_LIST_FOREACH(plugin->items, l, it)
+ it->priority = prio++;
- return 0;
+ return 1;
}
static Evas_Object *
}
}
- if (p->items)
- {
- p->items = eina_list_sort(p->items, eina_list_count(p->items), _cb_sort);
-
- return 1;
- }
+ if (!p->items) return 0;
+
+ EVRY_PLUGIN_ITEMS_SORT(p, _cb_sort);
- return 0;
+ return 1;
}
static Evas_Object *
_act_cb_border_close,
"window-close", input);
- if (eina_list_count(p->items) > 0)
- {
- p->items = eina_list_sort(p->items, eina_list_count(p->items), _cb_sort);
- return 1;
- }
+ if (!p->items) return 0;
- return 0;
+ EVRY_PLUGIN_ITEMS_SORT(p, _cb_sort);
+
+ return 1;
}
static int
p->base.items = NULL;
p->file = file;
- it = evry_item_new(NULL, plugin, _("Set as Wallpaper"), NULL);
+ it = evry_item_new(NULL, EVRY_PLUGIN(p), _("Set as Wallpaper"), NULL);
it->browseable = EINA_TRUE;
p->items = eina_list_append(p->items, it);
{
PLUGIN(p, plugin);
- if (p->prev)
+ if (p->prev && p->prev->file)
{
Import *import;
Item *it = (Item*) item;