From: Enlightenment S. <no-...@en...> - 2010-04-30 22:12:10
|
Log: - keep track of async requests. dont handle old ones - copy icon 'new .desktop' action Author: jeffdameth Date: 2010-04-30 15:12:02 -0700 (Fri, 30 Apr 2010) New Revision: 48495 Modified: trunk/e/src/modules/everything-apps/e_mod_main.c trunk/e/src/modules/everything-aspell/e_mod_main.c trunk/e/src/modules/everything-files/e_mod_main.c trunk/e/src/modules/everything/Evry.h trunk/e/src/modules/everything/evry.c Modified: trunk/e/src/modules/everything/Evry.h =================================================================== --- trunk/e/src/modules/everything/Evry.h 2010-04-30 22:05:54 UTC (rev 48494) +++ trunk/e/src/modules/everything/Evry.h 2010-04-30 22:12:02 UTC (rev 48495) @@ -3,7 +3,7 @@ #include "e.h" -#define EVRY_API_VERSION 9 +#define EVRY_API_VERSION 10 #define EVRY_ACTION_OTHER 0 #define EVRY_ACTION_FINISHED 1 @@ -276,6 +276,9 @@ /* config path registered for the module */ const char *config_path; + + /* do not set by plugin! */ + unsigned int request; }; @@ -305,6 +308,8 @@ Eina_Bool changed; Eina_Bool trigger_active; + + unsigned int request; }; struct _Evry_View Modified: trunk/e/src/modules/everything/evry.c =================================================================== --- trunk/e/src/modules/everything/evry.c 2010-04-30 22:05:54 UTC (rev 48494) +++ trunk/e/src/modules/everything/evry.c 2010-04-30 22:12:02 UTC (rev 48495) @@ -499,6 +499,12 @@ if (!sel || !sel->state) return; s = sel->state; + + DBG("update %d %d %s", s->request, p->request, p->name); + + if (s->request != p->request) + return; + agg = sel->aggregator; if (action == EVRY_ASYNC_UPDATE_ADD) @@ -1948,11 +1954,15 @@ else input = NULL; + s->request++; + DBG("matches update %d", s->request); + if (s->sel_items) eina_list_free(s->sel_items); s->sel_items = NULL; - if (!input || !s->trigger_active) + if ((!input || !s->trigger_active) && + (!win->plugin_dedicated)) { EINA_LIST_FREE(s->cur_plugins, p); s->trigger_active = EINA_FALSE; @@ -1960,9 +1970,13 @@ else { EINA_LIST_FOREACH(s->cur_plugins, l, p) - p->fetch(p, s->input); + { + p->request = s->request; + p->fetch(p, s->input); + } } + /* check if input matches plugin trigger */ if (!s->cur_plugins && input) { int len_trigger = 0; @@ -1970,7 +1984,6 @@ EINA_LIST_FOREACH(s->plugins, l, p) { - /* input matches plugin trigger? */ if (!p->config->trigger) continue; int len = strlen(p->config->trigger); @@ -1982,6 +1995,7 @@ { len_trigger = len; s->cur_plugins = eina_list_append(s->cur_plugins, p); + p->request = s->request; if(len_inp == len) p->fetch(p, NULL); else @@ -2008,23 +2022,24 @@ EINA_LIST_FOREACH(s->plugins, l, p) { - if (!(win->plugin_dedicated) && - (p->config->trigger_only) && - (p->config->trigger)) + if ((p->config->trigger) && (p->config->trigger_only)) continue; + if (p == sel->aggregator) continue; + /* dont wait for async plugin. use their current items */ if (!async && p->async_fetch && p->items) { s->cur_plugins = eina_list_append(s->cur_plugins, p); + continue; } - else + + p->request = s->request; + + if ((p->fetch(p, input)) || (sel->states->next)) { - if ((p->fetch(p, input)) || - (sel->states->next) || - (win->plugin_dedicated)) - s->cur_plugins = eina_list_append(s->cur_plugins, p); + s->cur_plugins = eina_list_append(s->cur_plugins, p); } } } Modified: trunk/e/src/modules/everything-apps/e_mod_main.c =================================================================== --- trunk/e/src/modules/everything-apps/e_mod_main.c 2010-04-30 22:05:54 UTC (rev 48494) +++ trunk/e/src/modules/everything-apps/e_mod_main.c 2010-04-30 22:12:02 UTC (rev 48495) @@ -923,6 +923,8 @@ desktop->generic_name = strdup(app->desktop->generic_name); if (app->desktop->exec) desktop->exec = strdup(app->desktop->exec); + if (app->desktop->icon) + desktop->icon = strdup(app->desktop->icon); if (app->desktop->mime_types) desktop->mime_types = eina_list_clone(app->desktop->mime_types); } Modified: trunk/e/src/modules/everything-aspell/e_mod_main.c =================================================================== --- trunk/e/src/modules/everything-aspell/e_mod_main.c 2010-04-30 22:05:54 UTC (rev 48494) +++ trunk/e/src/modules/everything-aspell/e_mod_main.c 2010-04-30 22:12:02 UTC (rev 48495) @@ -240,7 +240,8 @@ evry_list_win_show(); } - evry_plugin_async_update(EVRY_PLUGIN(p), EVRY_ASYNC_UPDATE_ADD); + if (p->base.items) + evry_plugin_async_update(EVRY_PLUGIN(p), EVRY_ASYNC_UPDATE_ADD); return 1; } @@ -395,7 +396,8 @@ p->history = EINA_FALSE; p->async_fetch = EINA_TRUE; p->trigger = TRIGGER; - + p->view_mode = VIEW_MODE_LIST; + evry_plugin_register(p, EVRY_PLUGIN_SUBJECT, 100); _plug = (Plugin *) p; Modified: trunk/e/src/modules/everything-files/e_mod_main.c =================================================================== --- trunk/e/src/modules/everything-files/e_mod_main.c 2010-04-30 22:05:54 UTC (rev 48494) +++ trunk/e/src/modules/everything-files/e_mod_main.c 2010-04-30 22:12:02 UTC (rev 48495) @@ -379,17 +379,16 @@ const char *label; Eina_List *ll, *l; - EVRY_PLUGIN_ITEMS_CLEAR(p); - switch (event) { case ECORE_FILE_EVENT_DELETED_SELF: - EINA_LIST_FREE(p->files, file) + EINA_LIST_FREE(p->files, file) evry_item_free(EVRY_ITEM(file)); break; case ECORE_FILE_EVENT_CREATED_DIRECTORY: case ECORE_FILE_EVENT_CREATED_FILE: + DBG("added %s", path); label = ecore_file_file_get(path); @@ -408,18 +407,25 @@ _item_fill(file); } p->files = eina_list_append(p->files, file); + break; case ECORE_FILE_EVENT_DELETED_FILE: case ECORE_FILE_EVENT_DELETED_DIRECTORY: label = eina_stringshare_add(path); + DBG("delete %s", path); EINA_LIST_FOREACH_SAFE(p->files, l, ll, file) { if (file->path != label) continue; p->files = eina_list_remove_list(p->files, l); - p->hist_added = eina_list_remove(p->hist_added, file); + if (eina_list_data_find_list(p->hist_added, file)) + { + p->hist_added = eina_list_remove(p->hist_added, file); + evry_item_free(EVRY_ITEM(file)); + } + evry_item_free(EVRY_ITEM(file)); break; } @@ -476,14 +482,14 @@ else if (it && CHECK_TYPE(it, EVRY_TYPE_ACTION)) { /* provide object */ - GET_ACTION(act, it); + /* GET_ACTION(act, it); */ p = E_NEW(Plugin, 1); p->base = *plugin; p->base.items = NULL; - if (act->it2.subtype == EVRY_TYPE_DIR) - p->dirs_only = EINA_TRUE; + /* if (act->it2.subtype == EVRY_TYPE_DIR) + * p->dirs_only = EINA_TRUE; */ p->directory = eina_stringshare_add(e_user_homedir_get()); p->parent = EINA_FALSE; @@ -499,7 +505,7 @@ p->directory = eina_stringshare_add(e_user_homedir_get()); /* p->show_recent = (_conf->show_recent || _conf->search_recent); */ - p->show_recent = EINA_TRUE; + p->show_recent = EINA_TRUE; p->parent = EINA_FALSE; } else @@ -875,7 +881,7 @@ } } } - + if (input && !p->command) p->input = eina_stringshare_add(input); |