reorder get_file_icon to get theme icons for mount points

SVN revision: 49048
This commit is contained in:
Hannes Janetzek 2010-05-20 04:38:53 +00:00
parent d57aba55b1
commit a3e9a1d7eb
2 changed files with 25 additions and 18 deletions

View File

@ -157,7 +157,7 @@ _thumb_idler(void *data)
if ((CHECK_TYPE(it->item, EVRY_TYPE_FILE)) &&
((!it->thumb && !(it->have_thumb || it->do_thumb)) &&
(it->get_thumb || _check_item(it->item) ||
(it->item->icon && it->item->icon[0]))))
(it->item->icon && it->item->icon[0] == '/'))))
{
it->get_thumb = EINA_TRUE;

View File

@ -422,6 +422,7 @@ _evry_icon_fdo_set(Evas_Object *obj, const char *icon)
if ((!icon) || (!icon[0])) return 0;
path = efreet_icon_path_find(e_config->icon_theme, icon, 128);
printf("path %s\n", path);
if (!path) return 0;
e_icon_scale_size_set(obj, 128);
@ -508,22 +509,25 @@ _file_icon_get(Evry_Item *it, Evas *e)
Evas_Object *o = NULL;
GET_FILE(file, it);
if (it->browseable)
{
return evry_icon_theme_get("folder", e);
}
if (it->icon)
{
o = e_icon_add(e);
if (!e_icon_file_set(o, it->icon))
if (it->icon[0] == '/')
{
evas_object_del(o);
o = NULL;
if (!e_icon_file_set(o, it->icon))
{
evas_object_del(o);
o = NULL;
}
}
else
{
o = evry_icon_theme_get(it->icon, e);
}
}
if ((!o) && (!it->icon) && file->mime &&
if (!(o) && (!it->icon) && file->mime &&
((!strncmp(file->mime, "image/", 6)) ||
(!strncmp(file->mime, "video/", 6)) ||
(!strncmp(file->mime, "application/pdf", 15))) &&
@ -542,7 +546,10 @@ _file_icon_get(Evry_Item *it, Evas *e)
it->icon = eina_stringshare_add("");
}
if ((!o) && file->mime)
if (!(o) &&it->browseable)
o = evry_icon_theme_get("folder", e);
if (!(o) && file->mime)
o = evry_icon_mime_get(file->mime, e);
if (!o)
@ -556,16 +563,16 @@ evry_util_icon_get(Evry_Item *it, Evas *e)
{
Evas_Object *o = NULL;
if (!o && it->icon_get)
o = it->icon_get(it, e);
if (o) return o;
if (CHECK_TYPE(it, EVRY_TYPE_FILE))
o = _file_icon_get(it, e);
else
{
if (!o && it->icon_get)
o = it->icon_get(it, e);
if (o) return o;
if (!o && it->icon)
o = evry_icon_theme_get(it->icon, e);
}
if (!o && it->icon)
o = evry_icon_theme_get(it->icon, e);
return o;
}