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;
|
||||
}
|
||||
|
||||
/* find plugins that provide the second item required for an action */
|
||||
static int
|
||||
_evry_selector_objects_get(Evry_Action *act)
|
||||
{
|
||||
|
@ -1014,26 +1015,28 @@ _evry_selector_objects_get(Evry_Action *act)
|
|||
Evry_Plugin *p, *plugin;
|
||||
Evry_Selector *sel = selectors[2];
|
||||
Evry_Item *it;
|
||||
/* required type */
|
||||
const char *type_in = act->type_in2;
|
||||
|
||||
|
||||
while (sel->state)
|
||||
_evry_state_pop(sel);
|
||||
|
||||
it = selectors[0]->state->sel_item;
|
||||
|
||||
|
||||
EINA_LIST_FOREACH(sel->plugins, l, plugin)
|
||||
{
|
||||
/* plugin doesnt provide reuired type */
|
||||
if ((plugin->type_out != type_in) &&
|
||||
(plugin != sel->aggregator)) continue;
|
||||
|
||||
(plugin != sel->aggregator))
|
||||
continue;
|
||||
|
||||
if (plugin->begin)
|
||||
{
|
||||
if ((act->type_out) &&
|
||||
(act->type_out == plugin->type_in) &&
|
||||
(!act->intercept || act->intercept(act)) &&
|
||||
(p = plugin->begin(plugin, it)))
|
||||
plugins = eina_list_append(plugins, p);
|
||||
else if ((p = plugin->begin(plugin, NULL)))
|
||||
/* plugins' begin method might require an item */
|
||||
/* like tracker searches files that match mimetype
|
||||
* of an application (item1) */
|
||||
if (((p = plugin->begin(plugin, it))) ||
|
||||
((p = plugin->begin(plugin, NULL))))
|
||||
plugins = eina_list_append(plugins, p);
|
||||
}
|
||||
else
|
||||
|
@ -1472,8 +1475,6 @@ _evry_plugin_action(Evry_Selector *sel, int finished)
|
|||
act->item2 = it_object;
|
||||
|
||||
act->action(act);
|
||||
|
||||
if (act->cleanup) act->cleanup(act);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -8,13 +8,14 @@ static void
|
|||
_cleanup(Evry_Plugin *p)
|
||||
{
|
||||
Evry_Item *it;
|
||||
Evry_Action *act;
|
||||
Evry_Selector *sel = selectors[1];
|
||||
|
||||
EINA_LIST_FREE(p->items, it)
|
||||
evry_item_free(it);
|
||||
|
||||
if (sel->actions) eina_list_free(sel->actions);
|
||||
sel->actions = NULL;
|
||||
EINA_LIST_FREE(sel->actions, act)
|
||||
if (act->cleanup) act->cleanup(act);
|
||||
}
|
||||
|
||||
static Evry_Plugin *
|
||||
|
@ -38,6 +39,10 @@ _begin(Evry_Plugin *p, const Evry_Item *it)
|
|||
(!act->check_item || act->check_item(act, it)))
|
||||
{
|
||||
act->item1 = it;
|
||||
|
||||
if (act->type_out && act->intercept && !(act->intercept(act)))
|
||||
continue;;
|
||||
|
||||
sel->actions = eina_list_append(sel->actions, act);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -735,17 +735,17 @@ _exec_border_check_item(Evry_Action *act __UNUSED__, const Evry_Item *it)
|
|||
static int
|
||||
_exec_border_action(Evry_Action *act)
|
||||
{
|
||||
ITEM_APP(app, act->item1);
|
||||
|
||||
return _app_action(act->item1, act->item2);
|
||||
}
|
||||
|
||||
static int
|
||||
_exec_border_intercept(Evry_Action *act)
|
||||
{
|
||||
/* FIXME */
|
||||
if (!act || !act->item1) return 0;
|
||||
Evry_Item_App *app = E_NEW(Evry_Item_App, 1);
|
||||
E_Border *bd = act->item1->data;
|
||||
|
||||
|
||||
app->desktop = bd->desktop;
|
||||
act->item1 = EVRY_ITEM(app);
|
||||
|
||||
|
|
Loading…
Reference in New Issue