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
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
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,
{
Ecore_Event_Exe_Exit *ev;
E_Smart_Data *sd;
-
+ char *ext;
+
ev = event;
if (ev->pid != pid) return 1;
if (!thumb_files) return 1;
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,
#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;
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 */
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;
Evas *evasbuf;
int alpha;
+ ext = strrchr(file, '.');
+ if(ext)
+ {
+ if(!strcasecmp(ext, ".eap"))
+ return 1;
+ }
+
thumbpath = e_thumb_file_get(file);
if (!thumbpath)
{
evas_object_resize(im, width, height); \
return im
+ D(("e_thumb_evas_object_get: (%s)\n", file));
+
/* eap thumbnailer */
ext = strrchr(file, '.');
if(ext)
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;
}
}