forked from enlightenment/enlightenment
parent
bce8eb69d3
commit
2a1201bbdb
|
@ -618,7 +618,8 @@ _fetch(Evry_Plugin *plugin, const char *input)
|
|||
Eina_List *l, *ll, *previous;
|
||||
Efreet_Desktop *desktop;
|
||||
Evry_Item *it;
|
||||
|
||||
char *file;
|
||||
|
||||
plugin->changed = 0;
|
||||
|
||||
previous = plugin->items;
|
||||
|
@ -685,6 +686,21 @@ _fetch(Evry_Plugin *plugin, const char *input)
|
|||
EINA_LIST_FOREACH(plugin->items, l, it)
|
||||
evry_history_item_usage_set(evry_hist->subjects, it, input, NULL);
|
||||
}
|
||||
|
||||
if (!input)
|
||||
{
|
||||
EINA_LIST_FOREACH(e_exehist_list_get(), l, file)
|
||||
{
|
||||
double last_used = e_exehist_newest_run_get(file);
|
||||
History_Item *hi;
|
||||
it = (Evry_Item *)_item_add(p, NULL, file, 1);
|
||||
if (!eina_hash_find(evry_hist->subjects, it->id))
|
||||
{
|
||||
hi = evry_history_add(evry_hist->subjects, it, NULL, NULL);
|
||||
if (hi) hi->last_used = last_used;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (plugin->type != type_action || input)
|
||||
EVRY_PLUGIN_ITEMS_SORT(plugin, _cb_sort);
|
||||
|
|
|
@ -372,6 +372,7 @@ _act_fetch(Evry_Plugin *p, const char *input)
|
|||
E_Desk *desk;
|
||||
Eina_List *l;
|
||||
Evry_Item *it;
|
||||
int prio = 0;
|
||||
|
||||
zone = e_util_zone_current_get(e_manager_current_get());
|
||||
desk = e_desk_current_get(zone);
|
||||
|
|
|
@ -435,7 +435,7 @@ EAPI void evry_view_unregister(Evry_View *view);
|
|||
|
||||
EAPI void evry_history_load(void);
|
||||
EAPI void evry_history_unload(void);
|
||||
EAPI void evry_history_add(Eina_Hash *hist, Evry_State *s, const char *ctxt);
|
||||
EAPI History_Item *evry_history_add(Eina_Hash *hist, Evry_Item *it, const char *ctxt, const char *input);
|
||||
EAPI int evry_history_item_usage_set(Eina_Hash *hist, Evry_Item *it, const char *input, const char *ctxt);
|
||||
|
||||
#define EVRY_PLUGIN_NEW(_base, _name, _type, _in, _out, _begin, _cleanup, _fetch, _icon_get, _free) \
|
||||
|
|
|
@ -1212,7 +1212,7 @@ evry_browse_item(Evry_Selector *sel)
|
|||
if (!plugins)
|
||||
return 1;
|
||||
|
||||
evry_history_add(sel->history, s, NULL);
|
||||
evry_history_add(sel->history, s->cur_item, NULL, s->input);
|
||||
|
||||
if (s->view)
|
||||
{
|
||||
|
@ -1710,9 +1710,11 @@ _evry_plugin_action(Evry_Selector *sel, int finished)
|
|||
}
|
||||
else return;
|
||||
|
||||
evry_history_add(evry_hist->subjects, s_subject, NULL);
|
||||
evry_history_add(evry_hist->actions, s_action, s_subject->cur_item->context);
|
||||
evry_history_add(evry_hist->subjects, s_object, s_action->cur_item->context);
|
||||
evry_history_add(evry_hist->subjects, s_subject->cur_item, NULL, s_subject->input);
|
||||
if (s_action)
|
||||
evry_history_add(evry_hist->actions, s_action->cur_item, s_subject->cur_item->context, s_action->input);
|
||||
if (s_object)
|
||||
evry_history_add(evry_hist->subjects, s_object->cur_item, s_action->cur_item->context, s_object->input);
|
||||
|
||||
/* let subject and object plugin know that an action was performed */
|
||||
if (s_subject->plugin->action)
|
||||
|
|
|
@ -214,19 +214,15 @@ evry_history_unload(void)
|
|||
evry_hist = NULL;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evry_history_add(Eina_Hash *hist, Evry_State *s, const char *ctxt)
|
||||
EAPI History_Item *
|
||||
evry_history_add(Eina_Hash *hist, Evry_Item *it, const char *ctxt, const char *input)
|
||||
{
|
||||
History_Entry *he;
|
||||
History_Item *hi = NULL;
|
||||
Evry_Item *it;
|
||||
Eina_List *l;
|
||||
const char *id;
|
||||
|
||||
if (!s) return;
|
||||
|
||||
it = s->cur_item;
|
||||
if (!it || !it->plugin->history) return;
|
||||
if (!it || !it->plugin->history) return NULL;
|
||||
|
||||
id = (it->id ? it->id : it->label);
|
||||
|
||||
|
@ -268,15 +264,16 @@ evry_history_add(Eina_Hash *hist, Evry_State *s, const char *ctxt)
|
|||
if (ctxt && !hi->context)
|
||||
hi->context = eina_stringshare_ref(ctxt);
|
||||
|
||||
if (s->input)
|
||||
if (input)
|
||||
{
|
||||
|
||||
if (hi->input)
|
||||
eina_stringshare_del(hi->input);
|
||||
|
||||
hi->input = eina_stringshare_add(s->input);
|
||||
hi->input = eina_stringshare_add(input);
|
||||
}
|
||||
}
|
||||
}
|
||||
return hi;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
|
|
Loading…
Reference in New Issue