'everything' only keep item selected after fetch when it was manually selected

SVN revision: 48023
This commit is contained in:
Hannes Janetzek 2010-04-15 15:57:28 +00:00
parent d0fbe9424e
commit 1cd0ecace3
2 changed files with 14 additions and 4 deletions

View File

@ -1378,6 +1378,8 @@ _evry_cb_key_down(void *data __UNUSED__, int type __UNUSED__, void *event)
Evry_Item *it = s->cur_item;
evry_item_ref(it);
s->item_auto_selected = EINA_FALSE;
if (it->plugin->complete)
action = it->plugin->complete(it->plugin, it, &input);

View File

@ -4,6 +4,8 @@
typedef struct _Plugin Plugin;
static int _auto_selected;
struct _Plugin
{
Evry_Plugin base;
@ -50,10 +52,13 @@ _cb_sort(const void *data1, const void *data2)
const Evry_Item *it1 = data1;
const Evry_Item *it2 = data2;
if (it1->selected)
return -1;
if (it2->selected)
return 1;
if (!_auto_selected)
{
if (it1->selected)
return -1;
if (it2->selected)
return 1;
}
if (it1->usage && it2->usage)
return (it1->usage > it2->usage ? -1 : 1);
@ -217,6 +222,9 @@ _fetch(Evry_Plugin *plugin, const char *input)
if (items) eina_list_free(items);
/* XXX */
_auto_selected = p->selector->state->item_auto_selected;
if (input)
{
EVRY_PLUGIN_ITEMS_SORT(p, _cb_sort);