forked from enlightenment/enlightenment
'everything' only show items in aggregator that match input or are in history
when more than one plugin is active SVN revision: 42096
This commit is contained in:
parent
c5507a54dd
commit
b08b15d677
|
@ -279,6 +279,7 @@ evry_item_new(Evry_Item *base, Evry_Plugin *p, const char *label, void (*cb_free
|
||||||
it->free = cb_free;
|
it->free = cb_free;
|
||||||
|
|
||||||
it->ref = 1;
|
it->ref = 1;
|
||||||
|
it->usage = -1;
|
||||||
|
|
||||||
#ifdef CHECK_REFS
|
#ifdef CHECK_REFS
|
||||||
item_cnt++;
|
item_cnt++;
|
||||||
|
@ -403,8 +404,6 @@ evry_plugin_async_update(Evry_Plugin *p, int action)
|
||||||
/* update aggregator */
|
/* update aggregator */
|
||||||
if (eina_list_count(s->cur_plugins) > 0)
|
if (eina_list_count(s->cur_plugins) > 0)
|
||||||
{
|
{
|
||||||
agg->fetch(agg, s->input);
|
|
||||||
|
|
||||||
/* add aggregator */
|
/* add aggregator */
|
||||||
if (!(s->cur_plugins->data == agg))
|
if (!(s->cur_plugins->data == agg))
|
||||||
{
|
{
|
||||||
|
@ -413,6 +412,7 @@ evry_plugin_async_update(Evry_Plugin *p, int action)
|
||||||
if (s->plugin_auto_selected)
|
if (s->plugin_auto_selected)
|
||||||
_evry_plugin_select(s, agg);
|
_evry_plugin_select(s, agg);
|
||||||
}
|
}
|
||||||
|
agg->fetch(agg, s->input);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1707,8 +1707,8 @@ _evry_matches_update(Evry_Selector *sel, int async)
|
||||||
|
|
||||||
if (eina_list_count(s->cur_plugins) > 0)
|
if (eina_list_count(s->cur_plugins) > 0)
|
||||||
{
|
{
|
||||||
sel->aggregator->fetch(sel->aggregator, s->input);
|
|
||||||
s->cur_plugins = eina_list_prepend(s->cur_plugins, sel->aggregator);
|
s->cur_plugins = eina_list_prepend(s->cur_plugins, sel->aggregator);
|
||||||
|
sel->aggregator->fetch(sel->aggregator, s->input);
|
||||||
if (s->plugin_auto_selected)
|
if (s->plugin_auto_selected)
|
||||||
_evry_plugin_select(s, NULL);
|
_evry_plugin_select(s, NULL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,7 +97,7 @@ _fetch(Evry_Plugin *plugin, const char *input)
|
||||||
Plugin *p = (Plugin *) plugin;
|
Plugin *p = (Plugin *) plugin;
|
||||||
Evry_Plugin *pp;
|
Evry_Plugin *pp;
|
||||||
Evry_State *s;
|
Evry_State *s;
|
||||||
Eina_List *l, *ll;
|
Eina_List *l, *ll, *lll, *lp;
|
||||||
Evry_Item *it;
|
Evry_Item *it;
|
||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
Eina_List *items = NULL;
|
Eina_List *items = NULL;
|
||||||
|
@ -105,17 +105,16 @@ _fetch(Evry_Plugin *plugin, const char *input)
|
||||||
History_Item *hi;
|
History_Item *hi;
|
||||||
const char *id;
|
const char *id;
|
||||||
|
|
||||||
s = p->selector->state;
|
|
||||||
|
|
||||||
EVRY_PLUGIN_ITEMS_FREE(p);
|
EVRY_PLUGIN_ITEMS_FREE(p);
|
||||||
|
|
||||||
EINA_LIST_FOREACH(s->cur_plugins, l, pp)
|
s = p->selector->state;
|
||||||
cnt += eina_list_count(pp->items);
|
|
||||||
|
|
||||||
|
/* first is aggregator itself */
|
||||||
|
lp = s->cur_plugins->next;
|
||||||
|
|
||||||
if (input[0])
|
if (input[0])
|
||||||
{
|
{
|
||||||
EINA_LIST_FOREACH(s->cur_plugins, l, pp)
|
EINA_LIST_FOREACH(lp, l, pp)
|
||||||
{
|
{
|
||||||
EINA_LIST_FOREACH(pp->items, ll, it)
|
EINA_LIST_FOREACH(pp->items, ll, it)
|
||||||
{
|
{
|
||||||
|
@ -132,9 +131,10 @@ _fetch(Evry_Plugin *plugin, const char *input)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!input[0] || eina_list_count(items) < 50)
|
/* always append items of action selector */
|
||||||
|
if (!input[0] && (p->selector == selectors[1]))
|
||||||
{
|
{
|
||||||
EINA_LIST_FOREACH(s->cur_plugins, l, pp)
|
EINA_LIST_FOREACH(lp, l, pp)
|
||||||
{
|
{
|
||||||
for (cnt = 0, ll = pp->items; ll && cnt < 50; ll = ll->next, cnt++)
|
for (cnt = 0, ll = pp->items; ll && cnt < 50; ll = ll->next, cnt++)
|
||||||
{
|
{
|
||||||
|
@ -150,12 +150,22 @@ _fetch(Evry_Plugin *plugin, const char *input)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (items) eina_list_free(items);
|
EINA_LIST_FOREACH(lp, l, pp)
|
||||||
|
{
|
||||||
EINA_LIST_FOREACH(EVRY_PLUGIN(p)->items, l, it)
|
EINA_LIST_FOREACH(pp->items, ll, it)
|
||||||
{
|
{
|
||||||
cnt = 1;
|
cnt = 1;
|
||||||
if (it->usage) continue;
|
if (it->usage == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ((it->usage > 0) && (!eina_list_data_find_list(items, it)))
|
||||||
|
{
|
||||||
|
evry_item_ref(it);
|
||||||
|
it->fuzzy_match = 0;
|
||||||
|
items = eina_list_append(items, it);
|
||||||
|
EVRY_PLUGIN_ITEM_APPEND(p, it);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (it->plugin->item_id)
|
if (it->plugin->item_id)
|
||||||
id = it->plugin->item_id(it->plugin, it);
|
id = it->plugin->item_id(it->plugin, it);
|
||||||
|
@ -164,7 +174,7 @@ _fetch(Evry_Plugin *plugin, const char *input)
|
||||||
|
|
||||||
if ((he = eina_hash_find(p->selector->history, id)))
|
if ((he = eina_hash_find(p->selector->history, id)))
|
||||||
{
|
{
|
||||||
EINA_LIST_FOREACH(he->items, ll, hi)
|
EINA_LIST_FOREACH(he->items, lll, hi)
|
||||||
{
|
{
|
||||||
if ((hi->plugin == it->plugin->name) &&
|
if ((hi->plugin == it->plugin->name) &&
|
||||||
((!input[0]) || (!input[0] && !hi->input) ||
|
((!input[0]) || (!input[0] && !hi->input) ||
|
||||||
|
@ -176,8 +186,36 @@ _fetch(Evry_Plugin *plugin, const char *input)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
it->usage /= (double)cnt;
|
it->usage /= (double)cnt;
|
||||||
|
|
||||||
|
if (!eina_list_data_find_list(items, it))
|
||||||
|
{
|
||||||
|
evry_item_ref(it);
|
||||||
|
it->fuzzy_match = 0;
|
||||||
|
items = eina_list_append(items, it);
|
||||||
|
EVRY_PLUGIN_ITEM_APPEND(p, it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else it->usage = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* NOTE this is kind of weird. list_count returns 2 even if there is
|
||||||
|
only one item in list */
|
||||||
|
if (eina_list_count(lp) == 2)
|
||||||
|
{
|
||||||
|
pp = lp->data;
|
||||||
|
EINA_LIST_FOREACH(pp->items, l, it)
|
||||||
|
{
|
||||||
|
if (!eina_list_data_find_list(items, it))
|
||||||
|
{
|
||||||
|
evry_item_ref(it);
|
||||||
|
it->fuzzy_match = 0;
|
||||||
|
EVRY_PLUGIN_ITEM_APPEND(p, it);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (items) eina_list_free(items);
|
||||||
|
|
||||||
if (input[0])
|
if (input[0])
|
||||||
{
|
{
|
||||||
|
|
|
@ -163,9 +163,11 @@ _cleanup(Evry_Plugin *plugin)
|
||||||
|
|
||||||
/* TODO popup end func !!!
|
/* TODO popup end func !!!
|
||||||
- cleanup hash for open-with plugin */
|
- cleanup hash for open-with plugin */
|
||||||
|
if (added)
|
||||||
eina_hash_free(added);
|
eina_hash_free(added);
|
||||||
added = NULL;
|
added = NULL;
|
||||||
|
|
||||||
|
if (p->added)
|
||||||
eina_hash_free(p->added);
|
eina_hash_free(p->added);
|
||||||
|
|
||||||
EVRY_PLUGIN_ITEMS_CLEAR(p);
|
EVRY_PLUGIN_ITEMS_CLEAR(p);
|
||||||
|
|
|
@ -53,7 +53,7 @@ _cleanup(Evry_Plugin *p)
|
||||||
{
|
{
|
||||||
Ecore_Event_Handler *h;
|
Ecore_Event_Handler *h;
|
||||||
|
|
||||||
eina_hash_free(border_hash);
|
if (border_hash) eina_hash_free(border_hash);
|
||||||
border_hash = NULL;
|
border_hash = NULL;
|
||||||
|
|
||||||
EVRY_PLUGIN_ITEMS_CLEAR(p);
|
EVRY_PLUGIN_ITEMS_CLEAR(p);
|
||||||
|
|
Loading…
Reference in New Issue