diff --git a/src/modules/everything/evry_history.c b/src/modules/everything/evry_history.c index e364326d6..6092cf999 100644 --- a/src/modules/everything/evry_history.c +++ b/src/modules/everything/evry_history.c @@ -1,6 +1,6 @@ #include "e_mod_main.h" -#define HISTORY_VERSION 7 +#define HISTORY_VERSION 8 #define SEVEN_DAYS 604800 @@ -13,6 +13,7 @@ struct _Cleanup_Data double time; Eina_List *keys; Eina_Bool normalize; + const char *plugin; }; static E_Config_DD *hist_entry_edd = NULL; @@ -86,6 +87,13 @@ _hist_cleanup_cb(const Eina_Hash *hash, const void *key, void *data, void *fdata EINA_LIST_FOREACH_SAFE(he->items, l, ll, hi) { + /* item for this plugi nneed to be removed, e.g. on updates */ + if (d->plugin) + { + if (hi->plugin == d->plugin) + hi->transient = 1; + } + if (hi->last_used < d->time - SEVEN_DAYS) { hi->count--; @@ -135,7 +143,7 @@ evry_history_free(void) eina_hash_del_by_key(evry_hist->subjects, key); } - if (evry_hist->subjects) + if (evry_hist->actions) { eina_hash_foreach(evry_hist->actions, _hist_cleanup_cb, d); EINA_LIST_FREE(d->keys, key) @@ -155,7 +163,7 @@ void evry_history_load(void) { evry_hist = e_config_domain_load("module.everything.history", hist_edd); - + if (evry_hist && evry_hist->version != HISTORY_VERSION) { eina_hash_foreach(evry_hist->subjects, _hist_free_cb, NULL); diff --git a/src/modules/everything/evry_plug_aggregator.c b/src/modules/everything/evry_plug_aggregator.c index 0069193cb..41db0a437 100644 --- a/src/modules/everything/evry_plug_aggregator.c +++ b/src/modules/everything/evry_plug_aggregator.c @@ -178,7 +178,7 @@ _fetch(Evry_Plugin *plugin, const char *input) /* 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) + if ((eina_list_count(lp) == 2) || (!EVRY_PLUGIN(p)->items)) { pp = lp->data; EINA_LIST_FOREACH(pp->items, l, it) diff --git a/src/modules/everything/evry_view_plugin_tabs.c b/src/modules/everything/evry_view_plugin_tabs.c index 60a2c8bd9..d58323bd1 100644 --- a/src/modules/everything/evry_view_plugin_tabs.c +++ b/src/modules/everything/evry_view_plugin_tabs.c @@ -49,7 +49,7 @@ _tab_scroll_to(Tab_View *v, Evry_Plugin *p) e_box_align_set(v->o_tabs, 1.0 - align, 0.5); } else - e_box_align_set(v->o_tabs, 1.0, 0.5); + e_box_align_set(v->o_tabs, 0.0, 0.5); } static void @@ -119,7 +119,11 @@ _tabs_update(Tab_View *v) e_box_thaw(v->o_tabs); - if (s->plugin) + if (eina_list_count(s->cur_plugins) == 2) + { + e_box_align_set(v->o_tabs, 0.0, 0.5); + } + else if (s->plugin) _tab_scroll_to(v, s->plugin); } diff --git a/src/modules/everything/sources/evry_plug_apps.c b/src/modules/everything/sources/evry_plug_apps.c index 6e757d297..ddf2ae887 100644 --- a/src/modules/everything/sources/evry_plug_apps.c +++ b/src/modules/everything/sources/evry_plug_apps.c @@ -1,7 +1,5 @@ #include "e_mod_main.h" -#define TERM_ACTION_CMD "/usr/bin/xterm -hold -e '%s'" - typedef struct _Plugin Plugin; @@ -279,13 +277,22 @@ _item_add(Plugin *p, Efreet_Desktop *desktop, char *file, int match) app = E_NEW(Evry_Item_App, 1); if (desktop) - evry_item_new(EVRY_ITEM(app), EVRY_PLUGIN(p), desktop->name, _item_free); + { + evry_item_new(EVRY_ITEM(app), EVRY_PLUGIN(p), desktop->name, _item_free); + EVRY_ITEM(app)->id = eina_stringshare_add(desktop->exec); + } else - evry_item_new(EVRY_ITEM(app), EVRY_PLUGIN(p), file, _item_free); - + { + evry_item_new(EVRY_ITEM(app), EVRY_PLUGIN(p), file, _item_free); + EVRY_ITEM(app)->id = eina_stringshare_add(file); + } + app->desktop = desktop; - if (file) app->file = eina_stringshare_add(file); + /* XXX check required ? */ + if (file) + app->file = eina_stringshare_add(file); + eina_hash_add(p->added, exe, app); if (desktop) @@ -377,6 +384,28 @@ _cb_sort(const void *data1, const void *data2) else return 0; } +static Eina_Bool +_hist_items_add_cb(const Eina_Hash *hash, const void *key, void *data, void *fdata) +{ + History_Entry *he = data; + History_Item *hi; + Plugin *p = fdata; + Efreet_Desktop *d; + Eina_List *l; + + EINA_LIST_FOREACH(he->items, l, hi) + { + if (hi->plugin != p->base.name) + continue; + + if ((d = efreet_util_desktop_exec_find(key))) + _item_add(p, d, NULL, 1); + else + _item_add(p, NULL, (char *) key, 1); + } + return EINA_TRUE; +} + static int _fetch(Evry_Plugin *plugin, const char *input) { @@ -448,9 +477,11 @@ _fetch(Evry_Plugin *plugin, const char *input) /* add exe history items */ else if (!plugin->items) { - l = e_exehist_list_get(); - EINA_LIST_FREE(l, file) - _item_add(p, NULL, file, 1); + /* l = e_exehist_list_get(); + * EINA_LIST_FREE(l, file) + * _item_add(p, NULL, file, 1); */ + + eina_hash_foreach(evry_hist->subjects, _hist_items_add_cb, p); } /* add executables */ @@ -806,7 +837,7 @@ _scan_idler(void *data) E_Exe *ee; int different = 0; - /* FIXME: check theat they match or not */ + /* FIXME: check wheter they match or not */ for (l = exe_list, l2 = exe_list2; l && l2; l = l->next, l2 = l2->next) { if (strcmp(l->data, l2->data)) diff --git a/src/modules/everything/sources/evry_plug_border.c b/src/modules/everything/sources/evry_plug_border.c index c76aa7761..d2d278935 100644 --- a/src/modules/everything/sources/evry_plug_border.c +++ b/src/modules/everything/sources/evry_plug_border.c @@ -81,6 +81,7 @@ _item_add(Evry_Plugin *p, E_Border *bd, int match, int *prio) { it->priority = *prio; EVRY_PLUGIN_ITEM_APPEND(p, it); + it->fuzzy_match = match; *prio += 1; return; } diff --git a/src/modules/everything/views/evry_plug_view_thumb.c b/src/modules/everything/views/evry_plug_view_thumb.c index 28fc44311..5aef297be 100644 --- a/src/modules/everything/views/evry_plug_view_thumb.c +++ b/src/modules/everything/views/evry_plug_view_thumb.c @@ -943,8 +943,6 @@ _view_create(Evry_View *view, const Evry_State *s, const Evas_Object *swallow) v->state = s; v->evas = evas_object_evas_get(swallow); - printf("%d ---- %d\n", evry_conf->view_mode, parent->list_mode); - if (parent->list_mode < 0) v->list_mode = evry_conf->view_mode; else