forked from enlightenment/enlightenment
'everything'
- fix action interceptor code SVN revision: 41981
This commit is contained in:
parent
b7a889e15b
commit
2438e6acde
|
@ -1007,6 +1007,7 @@ _evry_selector_actions_get(Evry_Item *it)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* find plugins that provide the second item required for an action */
|
||||||
static int
|
static int
|
||||||
_evry_selector_objects_get(Evry_Action *act)
|
_evry_selector_objects_get(Evry_Action *act)
|
||||||
{
|
{
|
||||||
|
@ -1014,6 +1015,7 @@ _evry_selector_objects_get(Evry_Action *act)
|
||||||
Evry_Plugin *p, *plugin;
|
Evry_Plugin *p, *plugin;
|
||||||
Evry_Selector *sel = selectors[2];
|
Evry_Selector *sel = selectors[2];
|
||||||
Evry_Item *it;
|
Evry_Item *it;
|
||||||
|
/* required type */
|
||||||
const char *type_in = act->type_in2;
|
const char *type_in = act->type_in2;
|
||||||
|
|
||||||
while (sel->state)
|
while (sel->state)
|
||||||
|
@ -1023,17 +1025,18 @@ _evry_selector_objects_get(Evry_Action *act)
|
||||||
|
|
||||||
EINA_LIST_FOREACH(sel->plugins, l, plugin)
|
EINA_LIST_FOREACH(sel->plugins, l, plugin)
|
||||||
{
|
{
|
||||||
|
/* plugin doesnt provide reuired type */
|
||||||
if ((plugin->type_out != type_in) &&
|
if ((plugin->type_out != type_in) &&
|
||||||
(plugin != sel->aggregator)) continue;
|
(plugin != sel->aggregator))
|
||||||
|
continue;
|
||||||
|
|
||||||
if (plugin->begin)
|
if (plugin->begin)
|
||||||
{
|
{
|
||||||
if ((act->type_out) &&
|
/* plugins' begin method might require an item */
|
||||||
(act->type_out == plugin->type_in) &&
|
/* like tracker searches files that match mimetype
|
||||||
(!act->intercept || act->intercept(act)) &&
|
* of an application (item1) */
|
||||||
(p = plugin->begin(plugin, it)))
|
if (((p = plugin->begin(plugin, it))) ||
|
||||||
plugins = eina_list_append(plugins, p);
|
((p = plugin->begin(plugin, NULL))))
|
||||||
else if ((p = plugin->begin(plugin, NULL)))
|
|
||||||
plugins = eina_list_append(plugins, p);
|
plugins = eina_list_append(plugins, p);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1472,8 +1475,6 @@ _evry_plugin_action(Evry_Selector *sel, int finished)
|
||||||
act->item2 = it_object;
|
act->item2 = it_object;
|
||||||
|
|
||||||
act->action(act);
|
act->action(act);
|
||||||
|
|
||||||
if (act->cleanup) act->cleanup(act);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,13 +8,14 @@ static void
|
||||||
_cleanup(Evry_Plugin *p)
|
_cleanup(Evry_Plugin *p)
|
||||||
{
|
{
|
||||||
Evry_Item *it;
|
Evry_Item *it;
|
||||||
|
Evry_Action *act;
|
||||||
Evry_Selector *sel = selectors[1];
|
Evry_Selector *sel = selectors[1];
|
||||||
|
|
||||||
EINA_LIST_FREE(p->items, it)
|
EINA_LIST_FREE(p->items, it)
|
||||||
evry_item_free(it);
|
evry_item_free(it);
|
||||||
|
|
||||||
if (sel->actions) eina_list_free(sel->actions);
|
EINA_LIST_FREE(sel->actions, act)
|
||||||
sel->actions = NULL;
|
if (act->cleanup) act->cleanup(act);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Evry_Plugin *
|
static Evry_Plugin *
|
||||||
|
@ -38,6 +39,10 @@ _begin(Evry_Plugin *p, const Evry_Item *it)
|
||||||
(!act->check_item || act->check_item(act, it)))
|
(!act->check_item || act->check_item(act, it)))
|
||||||
{
|
{
|
||||||
act->item1 = it;
|
act->item1 = it;
|
||||||
|
|
||||||
|
if (act->type_out && act->intercept && !(act->intercept(act)))
|
||||||
|
continue;;
|
||||||
|
|
||||||
sel->actions = eina_list_append(sel->actions, act);
|
sel->actions = eina_list_append(sel->actions, act);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -735,14 +735,14 @@ _exec_border_check_item(Evry_Action *act __UNUSED__, const Evry_Item *it)
|
||||||
static int
|
static int
|
||||||
_exec_border_action(Evry_Action *act)
|
_exec_border_action(Evry_Action *act)
|
||||||
{
|
{
|
||||||
|
ITEM_APP(app, act->item1);
|
||||||
|
|
||||||
return _app_action(act->item1, act->item2);
|
return _app_action(act->item1, act->item2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_exec_border_intercept(Evry_Action *act)
|
_exec_border_intercept(Evry_Action *act)
|
||||||
{
|
{
|
||||||
/* FIXME */
|
|
||||||
if (!act || !act->item1) return 0;
|
|
||||||
Evry_Item_App *app = E_NEW(Evry_Item_App, 1);
|
Evry_Item_App *app = E_NEW(Evry_Item_App, 1);
|
||||||
E_Border *bd = act->item1->data;
|
E_Border *bd = act->item1->data;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue