elementary: use evas_object_image_extension_can_load_fast_get.
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 1 Jun 2011 14:33:13 +0000 (14:33 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 1 Jun 2011 14:33:13 +0000 (14:33 +0000)
git-svn-id: https://svn.enlightenment.org/svn/e/trunk/elementary@59873 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/elc_fileselector.c

index bb42a30..288c868 100644 (file)
@@ -227,34 +227,15 @@ _itc_icon_get(void        *data,
           elm_icon_standard_set(ic, "folder");
         else
           {
-             static const char *extensions[][2] = {
-               { ".jpg", "image" },
-               { ".png", "image" },
-               { ".gif", "image" },
-               { ".jpeg", "image" },
-               { NULL, NULL }
-             };
-             int len, i;
-             Eina_Bool found = EINA_FALSE;
-
-             len = eina_stringshare_strlen(filename);
-
-             for (i = 0; extensions[i][0]; ++i)
+             if (evas_object_image_extension_can_load_fast_get(filename))
                {
-                  int lext;
-
-                  lext = strlen(extensions[i][0]);
-                  if (len < lext) continue;
-                  if (!strcasecmp(filename + len - lext, extensions[i][0]))
-                    {
-                       found = EINA_TRUE;
-                       elm_icon_standard_set(ic, extensions[i][1]);
-                       elm_icon_thumb_set(ic, filename, NULL);
-                    }
+                  elm_icon_standard_set(ic, "image");
+                  elm_icon_thumb_set(ic, filename, NULL);
+               }
+             else
+               {
+                  elm_icon_standard_set(ic, "file");
                }
-
-             if (!found)
-               elm_icon_standard_set(ic, "file");
           }
 
         evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL,