'everything' files: remember mimetype in history -> dont stat files from sleeping drives
- better scale down icons than up SVN revision: 48089
This commit is contained in:
parent
3dfcb86235
commit
c30b76da87
|
@ -374,18 +374,22 @@ _hist_items_add_cb(const Eina_Hash *hash, const void *key, void *data, void *fda
|
|||
evry_item_new(EVRY_ITEM(file), EVRY_PLUGIN(p), label, _item_free);
|
||||
|
||||
file->path = eina_stringshare_add(key);
|
||||
if (hi->context)
|
||||
file->mime = eina_stringshare_add(hi->context);
|
||||
if (hi->context)
|
||||
if (hi->data)
|
||||
file->mime = eina_stringshare_add(hi->data);
|
||||
if (hi->data)
|
||||
EVRY_ITEM(file)->context = eina_stringshare_ref(file->mime);
|
||||
|
||||
EVRY_ITEM(file)->id = eina_stringshare_ref(file->path);
|
||||
|
||||
evry_util_file_detail_set(file);
|
||||
|
||||
if (ecore_file_is_dir(file->path))
|
||||
if ((!strcmp(file->mime, "inode/directory")) ||
|
||||
(!strcmp(file->mime, "inode/mount-point")))
|
||||
EVRY_ITEM(file)->browseable = EINA_TRUE;
|
||||
|
||||
/* if (ecore_file_is_dir(file->path))
|
||||
* EVRY_ITEM(file)->browseable = EINA_TRUE; */
|
||||
|
||||
p->files = eina_list_append(p->files, file);
|
||||
break;
|
||||
}
|
||||
|
@ -552,6 +556,35 @@ _open_term_action(Evry_Action *act)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
_action(Evry_Plugin *plugin, const Evry_Item *it)
|
||||
{
|
||||
ITEM_FILE(file, it);
|
||||
Eina_List *l;
|
||||
History_Item *hi;
|
||||
History_Entry *he;
|
||||
|
||||
he = eina_hash_find(evry_hist->subjects, file->path);
|
||||
printf("acn\n");
|
||||
|
||||
if (!he) return 0;
|
||||
|
||||
EINA_LIST_FOREACH(he->items, l, hi)
|
||||
{
|
||||
if (hi->type != plugin->type_out)
|
||||
continue;
|
||||
|
||||
if (hi->data)
|
||||
eina_stringshare_del(hi->data);
|
||||
|
||||
printf("added\n");
|
||||
hi->data = eina_stringshare_ref(file->mime);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static Eina_Bool
|
||||
module_init(void)
|
||||
{
|
||||
|
@ -561,6 +594,8 @@ module_init(void)
|
|||
p1 = EVRY_PLUGIN_NEW(NULL, "Files", type_subject, "FILE", "FILE",
|
||||
_begin, _cleanup, _fetch, _icon_get, NULL);
|
||||
|
||||
EVRY_PLUGIN(p1)->action = &_action;
|
||||
|
||||
p2 = EVRY_PLUGIN_NEW(NULL, "Files", type_object, "FILE", "FILE",
|
||||
_begin, _cleanup, _fetch, _icon_get, NULL);
|
||||
|
||||
|
|
|
@ -384,6 +384,7 @@ struct _History_Item
|
|||
double usage;
|
||||
int count;
|
||||
int transient;
|
||||
const char *data;
|
||||
};
|
||||
|
||||
/* evry.c */
|
||||
|
|
|
@ -38,6 +38,7 @@ evry_history_init(void)
|
|||
E_CONFIG_VAL(D, T, count, INT);
|
||||
E_CONFIG_VAL(D, T, transient, INT);
|
||||
E_CONFIG_VAL(D, T, type, STR);
|
||||
E_CONFIG_VAL(D, T, data, STR);
|
||||
#undef T
|
||||
#undef D
|
||||
hist_entry_edd = E_CONFIG_DD_NEW("History_Entry", History_Entry);
|
||||
|
@ -73,6 +74,8 @@ _hist_free_cb(const Eina_Hash *hash, const void *key, void *data, void *fdata)
|
|||
eina_stringshare_del(hi->context);
|
||||
if (hi->type)
|
||||
eina_stringshare_del(hi->type);
|
||||
if (hi->data)
|
||||
eina_stringshare_del(hi->data);
|
||||
E_FREE(hi);
|
||||
}
|
||||
|
||||
|
@ -114,6 +117,8 @@ _hist_cleanup_cb(const Eina_Hash *hash, const void *key, void *data, void *fdata
|
|||
eina_stringshare_del(hi->context);
|
||||
if (hi->type)
|
||||
eina_stringshare_del(hi->type);
|
||||
if (hi->data)
|
||||
eina_stringshare_del(hi->data);
|
||||
E_FREE(hi);
|
||||
|
||||
he->items = eina_list_remove_list(he->items, l);
|
||||
|
|
|
@ -266,7 +266,7 @@ _evry_icon_fdo_set(Evas_Object *obj, const char *icon)
|
|||
unsigned int size;
|
||||
|
||||
if ((!icon) || (!icon[0])) return 0;
|
||||
size = e_util_icon_size_normalize(72 * e_scale);
|
||||
size = e_util_icon_size_normalize(128 * e_scale);
|
||||
path = efreet_icon_path_find(e_config->icon_theme, icon, size);
|
||||
|
||||
if (!path) return 0;
|
||||
|
|
Loading…
Reference in New Issue