forked from enlightenment/enlightenment
efm - recent - fix up mis-sorting on re-load and make icons better
was missing thumbnails - now do them. fix re-sorting of items weirdly on re-load later. @fix
This commit is contained in:
parent
4814a63d4c
commit
6a72eb3cee
|
@ -104,6 +104,7 @@ _e_exec_recent_exists_filter(void)
|
||||||
{
|
{
|
||||||
_e_exec_recent->files =
|
_e_exec_recent->files =
|
||||||
eina_list_remove_list(_e_exec_recent->files, l);
|
eina_list_remove_list(_e_exec_recent->files, l);
|
||||||
|
eina_stringshare_del(fl->file);
|
||||||
free(fl);
|
free(fl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -160,7 +161,7 @@ _e_exec_recent_load(void)
|
||||||
}
|
}
|
||||||
fl->file = eina_stringshare_add(buf);
|
fl->file = eina_stringshare_add(buf);
|
||||||
fl->timestamp = (double)timi / 100.0;
|
fl->timestamp = (double)timi / 100.0;
|
||||||
_e_exec_recent->files = eina_list_prepend(_e_exec_recent->files, fl);
|
_e_exec_recent->files = eina_list_append(_e_exec_recent->files, fl);
|
||||||
}
|
}
|
||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
|
|
|
@ -163,7 +163,10 @@ _e_mod_menu_populate_item(void *data, Eio_File *handler EINA_UNUSED, const Eina_
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mime = efreet_mime_type_get(mi->label);
|
mime = efreet_mime_special_type_get(path);
|
||||||
|
|
||||||
|
if (!mime) mime = efreet_mime_globs_type_get(path);
|
||||||
|
if (!mime) mime = efreet_mime_fallback_type_get(path);
|
||||||
if (!mime) return;
|
if (!mime) return;
|
||||||
if (!strncmp(mime, "image/", 6))
|
if (!strncmp(mime, "image/", 6))
|
||||||
{
|
{
|
||||||
|
@ -440,13 +443,12 @@ _e_mod_menu_recent_cb(void *data EINA_UNUSED,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_e_mod_menu_populate_recent_cb(void *data EINA_UNUSED,
|
_e_mod_menu_populate_recent_cb(void *data EINA_UNUSED,
|
||||||
E_Menu *m EINA_UNUSED,
|
E_Menu *m EINA_UNUSED,
|
||||||
E_Menu_Item *mi EINA_UNUSED)
|
E_Menu_Item *mi EINA_UNUSED)
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
Eina_List *l, *ll;
|
||||||
Eina_List *files = (Eina_List *)e_exec_recent_files_get();
|
Eina_List *files = (Eina_List *)e_exec_recent_files_get();
|
||||||
E_Exec_Recent_File *fl;
|
E_Exec_Recent_File *fl;
|
||||||
E_Menu *subm;
|
E_Menu *subm;
|
||||||
|
@ -475,19 +477,25 @@ _e_mod_menu_populate_recent_cb(void *data EINA_UNUSED,
|
||||||
e_menu_item_callback_set(mi2, _e_mod_menu_recent_cb, NULL);
|
e_menu_item_callback_set(mi2, _e_mod_menu_recent_cb, NULL);
|
||||||
if (mime)
|
if (mime)
|
||||||
{
|
{
|
||||||
|
const char *icon = NULL;
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
const char *icon_file, *edje_file;
|
const E_Config_Mime_Icon *minf;
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "e/icons/fileman/mime/%s", mime);
|
EINA_LIST_FOREACH(e_config->mime_icons, ll, minf)
|
||||||
edje_file = e_theme_edje_file_get("base/theme/icons", buf);
|
|
||||||
if (edje_file)
|
|
||||||
{
|
{
|
||||||
e_menu_item_icon_edje_set(mi2, edje_file, buf);
|
if (!strcmp(minf->mime, mime))
|
||||||
|
{
|
||||||
|
icon = minf->icon;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if ((icon) && (!strcmp(icon, "THUMB")))
|
||||||
|
e_menu_item_icon_file_set(mi2, fl->file);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
icon_file = efreet_mime_type_icon_get(mime, e_config->icon_theme, 48);
|
snprintf(buf, sizeof(buf), "fileman/mime/%s", mime);
|
||||||
e_menu_item_icon_file_set(mi2, icon_file);
|
if (!e_util_menu_item_theme_icon_set(mi2, buf))
|
||||||
|
e_util_menu_item_theme_icon_set(mi2, "fileman/mime/unknown");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -495,7 +503,6 @@ _e_mod_menu_populate_recent_cb(void *data EINA_UNUSED,
|
||||||
e_menu_thaw(subm);
|
e_menu_thaw(subm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_e_mod_fileman_add_recent(E_Menu *m,
|
_e_mod_fileman_add_recent(E_Menu *m,
|
||||||
Eina_Bool need_separator)
|
Eina_Bool need_separator)
|
||||||
|
|
Loading…
Reference in New Issue