parent
88e7e4a849
commit
718a3eaafc
|
@ -145,7 +145,8 @@ e_fm_file_is_image(E_Fm_File *file)
|
||||||
if (!ext) return 0;
|
if (!ext) return 0;
|
||||||
|
|
||||||
D(("e_fm_file_is_image: (%p)\n", file));
|
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
|
int
|
||||||
|
@ -160,18 +161,18 @@ e_fm_file_can_exec(E_Fm_File *file)
|
||||||
if(!strcasecmp(ext, ".eap"))
|
if(!strcasecmp(ext, ".eap"))
|
||||||
{
|
{
|
||||||
D(("e_fm_file_can_exec: true (%p) (%s)\n", file, file->name));
|
D(("e_fm_file_can_exec: true (%p) (%s)\n", file, file->name));
|
||||||
return TRUE;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ecore_file_can_exec(file->path))
|
if(ecore_file_can_exec(file->path))
|
||||||
{
|
{
|
||||||
D(("e_fm_file_can_exec: true (%p) (%s)\n", file, file->name));
|
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));
|
D(("e_fm_file_can_exec: false (%p) (%s)\n", file, file->name));
|
||||||
return FALSE;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -336,7 +336,7 @@ _e_fm_icon_smart_show(Evas_Object *obj)
|
||||||
if (e_fm_file_is_image(sd->file))
|
if (e_fm_file_is_image(sd->file))
|
||||||
{
|
{
|
||||||
sd->thumb_path = e_thumb_file_get(sd->file->path);
|
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->image_object = e_thumb_evas_object_get(sd->file->path,
|
||||||
sd->evas,
|
sd->evas,
|
||||||
sd->w,
|
sd->w,
|
||||||
|
@ -485,7 +485,8 @@ _e_fm_icon_thumb_cb_exe_exit(void *data, int type, void *event)
|
||||||
{
|
{
|
||||||
Ecore_Event_Exe_Exit *ev;
|
Ecore_Event_Exe_Exit *ev;
|
||||||
E_Smart_Data *sd;
|
E_Smart_Data *sd;
|
||||||
|
char *ext;
|
||||||
|
|
||||||
ev = event;
|
ev = event;
|
||||||
if (ev->pid != pid) return 1;
|
if (ev->pid != pid) return 1;
|
||||||
if (!thumb_files) return 1;
|
if (!thumb_files) return 1;
|
||||||
|
@ -493,7 +494,12 @@ _e_fm_icon_thumb_cb_exe_exit(void *data, int type, void *event)
|
||||||
sd = thumb_files->data;
|
sd = thumb_files->data;
|
||||||
thumb_files = evas_list_remove_list(thumb_files, thumb_files);
|
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);
|
if (sd->image_object) evas_object_del(sd->image_object);
|
||||||
sd->image_object = e_thumb_evas_object_get(sd->file->path,
|
sd->image_object = e_thumb_evas_object_get(sd->file->path,
|
||||||
|
|
|
@ -4,6 +4,12 @@
|
||||||
|
|
||||||
#include "e.h"
|
#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 *_e_thumb_file_id(char *file);
|
||||||
|
|
||||||
static char *thumb_path = NULL;
|
static char *thumb_path = NULL;
|
||||||
|
@ -56,18 +62,26 @@ e_thumb_file_get(char *file)
|
||||||
return strdup(thumb);
|
return strdup(thumb);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check wether a file has a saved thumb */
|
/* return true if the saved thumb exists OR if its an eap */
|
||||||
int
|
int
|
||||||
e_thumb_exists(char *file)
|
e_thumb_exists(char *file)
|
||||||
{
|
{
|
||||||
char *thumb;
|
char *thumb;
|
||||||
int ret;
|
char *ext;
|
||||||
|
|
||||||
|
ext = strrchr(file, '.');
|
||||||
|
if(ext)
|
||||||
|
if(!strcasecmp(ext, ".eap"))
|
||||||
|
return 1;
|
||||||
|
|
||||||
thumb = e_thumb_file_get(file);
|
thumb = e_thumb_file_get(file);
|
||||||
ret = ecore_file_exists(thumb);
|
if(ecore_file_exists(thumb))
|
||||||
free(thumb);
|
{
|
||||||
|
free(thumb);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* create and save a thumb to disk */
|
/* create and save a thumb to disk */
|
||||||
|
@ -75,7 +89,7 @@ int
|
||||||
e_thumb_create(char *file, Evas_Coord w, Evas_Coord h)
|
e_thumb_create(char *file, Evas_Coord w, Evas_Coord h)
|
||||||
{
|
{
|
||||||
Eet_File *ef;
|
Eet_File *ef;
|
||||||
char *thumbpath;
|
char *thumbpath, *ext;
|
||||||
Evas_Object *im;
|
Evas_Object *im;
|
||||||
const int *data;
|
const int *data;
|
||||||
int size, iw, ih, ww, hh;
|
int size, iw, ih, ww, hh;
|
||||||
|
@ -83,6 +97,13 @@ e_thumb_create(char *file, Evas_Coord w, Evas_Coord h)
|
||||||
Evas *evasbuf;
|
Evas *evasbuf;
|
||||||
int alpha;
|
int alpha;
|
||||||
|
|
||||||
|
ext = strrchr(file, '.');
|
||||||
|
if(ext)
|
||||||
|
{
|
||||||
|
if(!strcasecmp(ext, ".eap"))
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
thumbpath = e_thumb_file_get(file);
|
thumbpath = e_thumb_file_get(file);
|
||||||
if (!thumbpath)
|
if (!thumbpath)
|
||||||
{
|
{
|
||||||
|
@ -155,6 +176,8 @@ e_thumb_evas_object_get(char *file, Evas *evas, Evas_Coord width, Evas_Coord hei
|
||||||
evas_object_resize(im, width, height); \
|
evas_object_resize(im, width, height); \
|
||||||
return im
|
return im
|
||||||
|
|
||||||
|
D(("e_thumb_evas_object_get: (%s)\n", file));
|
||||||
|
|
||||||
/* eap thumbnailer */
|
/* eap thumbnailer */
|
||||||
ext = strrchr(file, '.');
|
ext = strrchr(file, '.');
|
||||||
if(ext)
|
if(ext)
|
||||||
|
@ -162,18 +185,22 @@ e_thumb_evas_object_get(char *file, Evas *evas, Evas_Coord width, Evas_Coord hei
|
||||||
if(!strcasecmp(ext, ".eap"))
|
if(!strcasecmp(ext, ".eap"))
|
||||||
{
|
{
|
||||||
E_App *app;
|
E_App *app;
|
||||||
|
|
||||||
|
D(("e_thumb_evas_object_get: eap found\n"));
|
||||||
app = e_app_new(file, 0);
|
app = e_app_new(file, 0);
|
||||||
|
D(("e_thumb_evas_object_get: eap loaded\n"));
|
||||||
if(!app)
|
if(!app)
|
||||||
{
|
{
|
||||||
|
D(("e_thumb_evas_object_get: invalid eap\n"));
|
||||||
DEF_THUMB_RETURN;
|
DEF_THUMB_RETURN;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
D(("e_thumb_evas_object_get: creating eap thumb\n"));
|
||||||
im = edje_object_add(evas);
|
im = edje_object_add(evas);
|
||||||
edje_object_file_set(im, file, "icon");
|
edje_object_file_set(im, file, "icon");
|
||||||
e_object_unref(E_OBJECT(app));
|
e_object_unref(E_OBJECT(app));
|
||||||
|
D(("e_thumb_evas_object_get: returning eap thumb\n"));
|
||||||
return im;
|
return im;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue