forked from enlightenment/enlightenment
'everything'
- remember full exec path to get the right .desktops ... bump history version number for this. - fixes: update border match value -> show them in aggregator. show items of first plugin in aggregator when no items found from history. SVN revision: 42685
This commit is contained in:
parent
a4fb397e83
commit
8c4812092d
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue