Enlightenment CVS committal

Author  : codewarrior
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_fileman_file.c e_fileman_icon.c e_thumb.c 


Log Message:
- fix eap thumbnailing


===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_fileman_file.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- e_fileman_file.c    20 Oct 2005 13:08:51 -0000      1.1
+++ e_fileman_file.c    21 Oct 2005 09:52:46 -0000      1.2
@@ -145,7 +145,8 @@
    if (!ext) return 0;
    
    D(("e_fm_file_is_image: (%p)\n", file));
-   return (!strcasecmp(ext, ".jpg")) || (!strcasecmp(ext, ".png"));
+   return (!strcasecmp(ext, ".jpg")) || (!strcasecmp(ext, ".png"))
+     || (!strcasecmp(ext, ".jpeg")) || (!strcasecmp(ext, ".eap"));
 }
 
 int
@@ -160,18 +161,18 @@
        if(!strcasecmp(ext, ".eap"))
        {
           D(("e_fm_file_can_exec: true (%p) (%s)\n", file, file->name));
-          return TRUE;
+          return 1;
        }
     }
    
    if(ecore_file_can_exec(file->path))
     {
        D(("e_fm_file_can_exec: true (%p) (%s)\n", file, file->name));
-       return TRUE;
+       return 1;
     }
    
    D(("e_fm_file_can_exec: false (%p) (%s)\n", file, file->name));
-   return FALSE;
+   return 0;
 }
 
 int
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_fileman_icon.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- e_fileman_icon.c    21 Oct 2005 03:00:08 -0000      1.3
+++ e_fileman_icon.c    21 Oct 2005 09:52:46 -0000      1.4
@@ -336,7 +336,7 @@
    if (e_fm_file_is_image(sd->file))
      {
        sd->thumb_path = e_thumb_file_get(sd->file->path);
-       if (ecore_file_exists(sd->thumb_path))
+       if (e_thumb_exists(sd->file->path))
          sd->image_object = e_thumb_evas_object_get(sd->file->path,
                                                     sd->evas,
                                                     sd->w,
@@ -485,7 +485,8 @@
 {
    Ecore_Event_Exe_Exit *ev;
    E_Smart_Data         *sd;
-
+   char                 *ext;
+   
    ev = event;
    if (ev->pid != pid) return 1;
    if (!thumb_files) return 1;
@@ -493,7 +494,12 @@
    sd = thumb_files->data;
    thumb_files = evas_list_remove_list(thumb_files, thumb_files);
    
-   if (ecore_file_exists(sd->thumb_path))
+   ext = strrchr(sd->file->name, ".");
+   if(ext)
+     if(strcasecmp(ext, ".eap"))
+       ext = NULL;
+   
+   if (ecore_file_exists(sd->thumb_path) || ext)
      {
        if (sd->image_object) evas_object_del(sd->image_object);
        sd->image_object = e_thumb_evas_object_get(sd->file->path,
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_thumb.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- e_thumb.c   21 Oct 2005 09:25:23 -0000      1.6
+++ e_thumb.c   21 Oct 2005 09:52:46 -0000      1.7
@@ -4,6 +4,12 @@
 
 #include "e.h"
 
+#ifdef EFM_DEBUG
+# define D(x)  do {printf(__FILE__ ":%d:  ", __LINE__); printf x; 
fflush(stdout);} while (0)
+#else
+# define D(x)  ((void) 0)
+#endif
+
 static char       *_e_thumb_file_id(char *file);
 
 static char       *thumb_path = NULL;
@@ -56,18 +62,26 @@
    return strdup(thumb);   
 }
 
-/* check wether a file has a saved thumb */
+/* return true if the saved thumb exists OR if its an eap */
 int
 e_thumb_exists(char *file)
 {
    char *thumb;
-   int ret;
+   char *ext;
+   
+   ext = strrchr(file, '.');
+   if(ext)
+     if(!strcasecmp(ext, ".eap"))       
+        return 1;
    
    thumb = e_thumb_file_get(file);
-   ret = ecore_file_exists(thumb);
-   free(thumb);
+   if(ecore_file_exists(thumb))
+    {
+       free(thumb);
+       return 1;
+    }
    
-   return ret;     
+   return 0;
 }
 
 /* create and save a thumb to disk */
@@ -75,7 +89,7 @@
 e_thumb_create(char *file, Evas_Coord w, Evas_Coord h)
 {
    Eet_File *ef;
-   char *thumbpath;
+   char *thumbpath, *ext;
    Evas_Object *im;
    const int *data;
    int size, iw, ih, ww, hh;
@@ -83,6 +97,13 @@
    Evas *evasbuf;
    int alpha;
    
+   ext = strrchr(file, '.');
+   if(ext)
+    {
+       if(!strcasecmp(ext, ".eap"))
+        return 1;
+    }
+   
    thumbpath = e_thumb_file_get(file);
    if (!thumbpath)
      {
@@ -155,6 +176,8 @@
               evas_object_resize(im, width, height); \
               return im 
    
+   D(("e_thumb_evas_object_get: (%s)\n", file));
+     
    /* eap thumbnailer */
    ext = strrchr(file, '.');
    if(ext)
@@ -162,18 +185,22 @@
        if(!strcasecmp(ext, ".eap"))
        {
           E_App *app;
-          
+
+          D(("e_thumb_evas_object_get: eap found\n"));
           app = e_app_new(file, 0);
-          
+          D(("e_thumb_evas_object_get: eap loaded\n"));
           if(!app)          
            { 
+              D(("e_thumb_evas_object_get: invalid eap\n"));
               DEF_THUMB_RETURN;
            }
           else
            {
+              D(("e_thumb_evas_object_get: creating eap thumb\n"));
               im = edje_object_add(evas);
               edje_object_file_set(im, file, "icon");
               e_object_unref(E_OBJECT(app));          
+              D(("e_thumb_evas_object_get: returning eap thumb\n"));
               return im;
            }
        }




-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to