[prev in list] [next in list] [prev in thread] [next in thread]
List: enlightenment-svn
Subject: E SVN: captainigloo IN trunk/PROTO/enna-explorer/src: bin
From: "Enlightenment SVN" <no-reply () enlightenment ! org>
Date: 2011-08-31 21:13:17
Message-ID: 20110831211317.CADA1300001 () e2 ! enlightenment ! org
[Download RAW message or body]
Log:
PROTO/enna-explorer : do not call efreet_mime_type_get in the main eio callback, it \
takes too long to retrieve the mime type. Retrieve mime type only when icons is \
displayed by the genlist/gengrid
Author: captainigloo
Date: 2011-08-31 14:13:17 -0700 (Wed, 31 Aug 2011)
New Revision: 63045
Trac: http://trac.enlightenment.org/e/changeset/63045
Modified:
trunk/PROTO/enna-explorer/src/bin/view_grid.c \
trunk/PROTO/enna-explorer/src/bin/view_list.c \
trunk/PROTO/enna-explorer/src/modules/browser/localfiles/localfiles.c
Modified: trunk/PROTO/enna-explorer/src/bin/view_grid.c
===================================================================
--- trunk/PROTO/enna-explorer/src/bin/view_grid.c 2011-08-31 21:09:30 UTC (rev 63044)
+++ trunk/PROTO/enna-explorer/src/bin/view_grid.c 2011-08-31 21:13:17 UTC (rev 63045)
@@ -89,48 +89,7 @@
static Evas_Object *
_grid_item_icon_get(void *data, Evas_Object *obj, const char *part)
{
-#if 0
- Grid_Item *gi = data;
- if (!gi)
- return NULL;
-
- if (!strcmp(part, "elm.swallow.icon"))
- {
- Evas_Object *ic;
-
- if (!gi->file)
- return NULL;
-
- if (ENNA_FILE_IS_BROWSABLE(gi->file))
- {
- ic = elm_icon_add(obj);
- if (gi->file->icon && gi->file->icon[0] == '/')
- elm_icon_file_set(ic, gi->file->icon, NULL);
- else if (gi->file->icon)
- elm_icon_file_set(ic, enna_config_theme_get(), gi->file->icon);
- else
- return NULL;
-
- //evas_object_size_hint_max_set(ic, 92, 92);
- //evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
- evas_object_show(ic);
- return ic;
- }
- else
- {
- ic = elm_thumb_add(obj);
- printf("file set : %s\n", gi->file->mrl + 7);
-
- elm_thumb_file_set(ic, gi->file->mrl + 7, NULL);
- evas_object_show(ic);
-
- return ic;
- }
- }
-
- return NULL;
-#endif
Grid_Item *gi = (Grid_Item*) data;
if (!gi) return NULL;
@@ -140,16 +99,23 @@
Evas_Object *ic;
ic = elm_icon_add(obj);
- elm_icon_order_lookup_set(ic, ELM_ICON_LOOKUP_FDO_THEME);
- if (gi->file->icon && gi->file->icon[0] == '/')
- elm_icon_standard_set(ic, gi->file->icon);
- else if (gi->file->icon)
- elm_icon_file_set(ic, enna_config_theme_get(), gi->file->icon);
+
+ if (ENNA_FILE_IS_BROWSABLE(gi->file))
+ {
+ elm_icon_file_set(ic, enna_config_theme_get(), gi->file->icon);
+ }
else
- return NULL;
+ {
+ const char *mime;
+ const char *icon;
- printf("mrl : %s\n", gi->file->mrl);
- elm_icon_thumb_set(ic, gi->file->mrl, NULL);
+ mime = efreet_mime_type_get(gi->file->mrl);
+ icon = efreet_mime_type_icon_get(mime, getenv("E_ICON_THEME"), 96);
+ if (!icon)
+ icon = efreet_mime_type_icon_get("unknown", getenv("E_ICON_THEME"), \
96); + elm_icon_file_set(ic, icon, NULL);
+ elm_icon_thumb_set(ic, gi->file->mrl, NULL);
+ }
evas_object_size_hint_min_set(ic, 96, 96);
evas_object_show(ic);
@@ -214,7 +180,7 @@
Grid_Item *gi;
if (!sd)
return;
- printf("gengrid clear\n");
+
elm_gengrid_clear(sd->o_grid);
EINA_LIST_FREE(sd->items, gi)
Modified: trunk/PROTO/enna-explorer/src/bin/view_list.c
===================================================================
--- trunk/PROTO/enna-explorer/src/bin/view_list.c 2011-08-31 21:09:30 UTC (rev 63044)
+++ trunk/PROTO/enna-explorer/src/bin/view_list.c 2011-08-31 21:13:17 UTC (rev 63045)
@@ -155,18 +155,31 @@
if (!strcmp(part, "elm.swallow.icon"))
{
- Evas_Object *ic;
+ Evas_Object *ic;
- ic = elm_icon_add(obj);
- if (li->file->icon && li->file->icon[0] == '/')
- elm_icon_file_set(ic, li->file->icon, NULL);
- else if (li->file->icon)
- elm_icon_file_set(ic, enna_config_theme_get(), li->file->icon);
- else
- return NULL;
- evas_object_size_hint_min_set(ic, 32, 32);
- evas_object_show(ic);
- return ic;
+ ic = elm_icon_add(obj);
+
+ if (ENNA_FILE_IS_BROWSABLE(li->file))
+ {
+ elm_icon_file_set(ic, enna_config_theme_get(), li->file->icon);
+ }
+ else
+ {
+ const char *mime;
+ const char *icon;
+
+ mime = efreet_mime_type_get(li->file->mrl);
+ icon = efreet_mime_type_icon_get(mime, getenv("E_ICON_THEME"), 48);
+ if (!icon)
+ icon = efreet_mime_type_icon_get("unknown", \
getenv("E_ICON_THEME"), 48); + elm_icon_file_set(ic, icon, NULL);
+ /* Don't generate thumb in list, it's too small */
+ /* elm_icon_thumb_set(ic, li->file->mrl, NULL); */
+ }
+
+ evas_object_size_hint_min_set(ic, 32, 32);
+ evas_object_show(ic);
+ return ic;
}
else if (!strcmp(part, "elm.swallow.end"))
{
Modified: trunk/PROTO/enna-explorer/src/modules/browser/localfiles/localfiles.c
===================================================================
--- trunk/PROTO/enna-explorer/src/modules/browser/localfiles/localfiles.c 2011-08-31 \
21:09:30 UTC (rev 63044)
+++ trunk/PROTO/enna-explorer/src/modules/browser/localfiles/localfiles.c 2011-08-31 \
21:13:17 UTC (rev 63045) @@ -766,19 +766,10 @@
else
{
if (priv->caps == ENNA_CAPS_ALL)
- {
- const char *mime;
- const char *icon;
+ f = enna_file_file_add(info->path + info->name_start, buf,
+ info->path, info->path + info->name_start,
+ "icon/file");
- mime = efreet_mime_type_get(info->path);
- icon = efreet_mime_type_icon_get(mime, getenv("E_ICON_THEME"), 48);
- if (!icon)
- icon = efreet_mime_type_icon_get("unknown", getenv("E_ICON_THEME"), \
48);
- f = enna_file_file_add(info->path + info->name_start, buf,
- info->path, info->path + info->name_start,
- icon);
-
- }
else if (priv->caps == ENNA_CAPS_MUSIC)
f = enna_file_track_add(info->path + info->name_start, buf,
info->path, info->path + info->name_start,
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
enlightenment-svn mailing list
enlightenment-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic