filter recent files to only show recent dirs when browsing copy-to location

SVN revision: 48447
This commit is contained in:
Hannes Janetzek 2010-04-30 00:38:36 +00:00
parent 61fb1fecf5
commit b945a5827f
1 changed files with 23 additions and 14 deletions

View File

@ -487,6 +487,7 @@ _begin(Evry_Plugin *plugin, const Evry_Item *it)
p->directory = eina_stringshare_add(e_user_homedir_get()); p->directory = eina_stringshare_add(e_user_homedir_get());
p->parent = EINA_FALSE; p->parent = EINA_FALSE;
p->show_recent = EINA_TRUE;
} }
else if (!it) else if (!it)
{ {
@ -496,6 +497,9 @@ _begin(Evry_Plugin *plugin, const Evry_Item *it)
p->base.items = NULL; p->base.items = NULL;
if (_conf->show_homedir) if (_conf->show_homedir)
p->directory = eina_stringshare_add(e_user_homedir_get()); p->directory = eina_stringshare_add(e_user_homedir_get());
/* p->show_recent = (_conf->show_recent || _conf->search_recent); */
p->show_recent = EINA_TRUE;
p->parent = EINA_FALSE; p->parent = EINA_FALSE;
} }
else else
@ -647,7 +651,9 @@ _hist_end_func(void *data)
it->label = eina_stringshare_add(file->path); it->label = eina_stringshare_add(file->path);
evry_item_ref(it); evry_item_ref(it);
p->files = eina_list_append(p->files, it);
if (!p->dirs_only || it->browseable)
p->files = eina_list_append(p->files, it);
} }
p->thread2 = NULL; p->thread2 = NULL;
@ -850,23 +856,26 @@ _fetch(Evry_Plugin *plugin, const char *input)
return 0; return 0;
} }
/* add recent files */ /* add recent files if not object plugin (p2) */
if ((!p->parent && !p->command && !p->hist_added) && if (p->show_recent)
((_conf->search_recent && input && strlen(input) > 1) ||
(_conf->show_recent)))
{ {
eina_hash_foreach(evry_hist->subjects, _hist_items_add_cb, p); if ((!p->parent && !p->command && !p->hist_added) &&
p->thread2 = ecore_thread_run(_hist_func, _hist_end_func, _hist_cancel_func, p); ((_conf->search_recent && input && strlen(input) > 1) ||
} (_conf->show_recent)))
else if (p->hist_added && !input && _conf->search_recent)
{
EINA_LIST_FREE(p->hist_added, file)
{ {
p->files = eina_list_remove(p->files, file); eina_hash_foreach(evry_hist->subjects, _hist_items_add_cb, p);
evry_item_free(EVRY_ITEM(file)); p->thread2 = ecore_thread_run(_hist_func, _hist_end_func, _hist_cancel_func, p);
}
else if (p->hist_added && !input && _conf->search_recent)
{
EINA_LIST_FREE(p->hist_added, file)
{
p->files = eina_list_remove(p->files, file);
evry_item_free(EVRY_ITEM(file));
}
} }
} }
if (input && !p->command) if (input && !p->command)
p->input = eina_stringshare_add(input); p->input = eina_stringshare_add(input);