forked from enlightenment/enlightenment
parent
12e9497d94
commit
38679d522c
|
@ -9,10 +9,40 @@
|
|||
# define D(x) ((void) 0)
|
||||
#endif
|
||||
|
||||
typedef struct _E_Fm_Assoc_App E_Fm_Assoc_App;
|
||||
struct _E_Fm_Assoc_App
|
||||
{
|
||||
char *mime;
|
||||
char *app;
|
||||
};
|
||||
|
||||
/* local subsystem functions */
|
||||
static void _e_fm_file_free(E_Fm_File *file);
|
||||
|
||||
/* TODO Make init and shutdown func that populates the assoc */
|
||||
static E_Config_DD *assoc_app_edd;
|
||||
static Evas_List *assoc_apps;
|
||||
|
||||
#if 0
|
||||
{
|
||||
E_Fm_Assoc_App *assoc;
|
||||
|
||||
assoc = E_NEW(E_Fm_Assoc_App, 1);
|
||||
assoc->mime = (char*)E_NEW(char *, 5);
|
||||
snprintf(assoc->mime, 5, "%s", ".jpg");
|
||||
assoc->app = (char*)E_NEW(char *, 7);
|
||||
snprintf(assoc->app, 7, "gqview");
|
||||
sd->conf.main->apps = evas_list_append(sd->conf.main->apps, assoc);
|
||||
|
||||
assoc = E_NEW(E_Fm_Assoc_App, 1);
|
||||
assoc->mime = (char*)E_NEW(char *, 5);
|
||||
snprintf(assoc->mime, 5, "%s", ".png");
|
||||
assoc->app = (char*)E_NEW(char *, 7);
|
||||
snprintf(assoc->app, 7, "gqview");
|
||||
sd->conf.main->apps = evas_list_append(sd->conf.main->apps, assoc);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* externally accessible functions */
|
||||
E_Fm_File *
|
||||
e_fm_file_new(const char *filename)
|
||||
|
@ -167,8 +197,8 @@ e_fm_file_is_image(E_Fm_File *file)
|
|||
if (!ext) return 0;
|
||||
|
||||
D(("e_fm_file_is_image: (%p)\n", file));
|
||||
return (!strcasecmp(ext, ".jpg")) || (!strcasecmp(ext, ".png"))
|
||||
|| (!strcasecmp(ext, ".jpeg"));
|
||||
return (!strcasecmp(ext, ".jpg")) || (!strcasecmp(ext, ".png")) ||
|
||||
(!strcasecmp(ext, ".jpeg"));
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -192,11 +222,13 @@ e_fm_file_is_etheme(E_Fm_File *file)
|
|||
return 0;
|
||||
|
||||
for (l = groups; l; l = l->next)
|
||||
{
|
||||
if (!strcmp(l->data, "widgets/border/default/border"))
|
||||
{
|
||||
val = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
edje_file_collection_list_free(groups);
|
||||
return val;
|
||||
}
|
||||
|
@ -222,11 +254,13 @@ e_fm_file_is_ebg(E_Fm_File *file)
|
|||
return 0;
|
||||
|
||||
for (l = groups; l; l = l->next)
|
||||
{
|
||||
if (!strcmp(l->data, "desktop/background"))
|
||||
{
|
||||
val = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
edje_file_collection_list_free(groups);
|
||||
return val;
|
||||
}
|
||||
|
@ -259,7 +293,6 @@ int
|
|||
e_fm_file_can_exec(E_Fm_File *file)
|
||||
{
|
||||
char *ext;
|
||||
char *fullname;
|
||||
|
||||
ext = strrchr(file->name, '.');
|
||||
if (ext)
|
||||
|
@ -287,7 +320,6 @@ e_fm_file_exec(E_Fm_File *file)
|
|||
Ecore_Exe *exe;
|
||||
char *ext;
|
||||
|
||||
|
||||
ext = strrchr(file->name, '.');
|
||||
if (ext)
|
||||
{
|
||||
|
@ -296,9 +328,9 @@ e_fm_file_exec(E_Fm_File *file)
|
|||
E_App *e_app;
|
||||
Ecore_Exe *exe;
|
||||
|
||||
e_app = e_app_new(file->path, NULL);
|
||||
e_app = e_app_new(file->path, 0);
|
||||
|
||||
if(!e_app) return;
|
||||
if (!e_app) return 0;
|
||||
|
||||
exe = ecore_exe_run(e_app->exe, NULL);
|
||||
if (exe) ecore_exe_free(exe);
|
||||
|
@ -327,6 +359,55 @@ e_fm_file_exec(E_Fm_File *file)
|
|||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
e_fm_file_assoc_set(E_Fm_File *file, const char *assoc)
|
||||
{
|
||||
/* TODO */
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
e_fm_file_assoc_exec(E_Fm_File *file)
|
||||
{
|
||||
char app[PATH_MAX * 2];
|
||||
Evas_List *l;
|
||||
E_Fm_Assoc_App *assoc;
|
||||
Ecore_Exe *exe;
|
||||
|
||||
for (l = assoc_apps; l; l = l->next)
|
||||
{
|
||||
char *ext;
|
||||
|
||||
assoc = l->data;
|
||||
ext = strrchr(file->path, '.');
|
||||
if ((ext) && (!strcasecmp(ext, assoc->mime)))
|
||||
break;
|
||||
assoc = NULL;
|
||||
}
|
||||
|
||||
if (!assoc) return 0;
|
||||
|
||||
snprintf(app, PATH_MAX * 2, "%s %s", assoc->app, file->path);
|
||||
exe = ecore_exe_run(app, NULL);
|
||||
|
||||
if (!exe)
|
||||
{
|
||||
e_error_dialog_show(_("Run Error"),
|
||||
_("Enlightenment was unable fork a child process:\n"
|
||||
"\n"
|
||||
"%s\n"
|
||||
"\n"),
|
||||
app);
|
||||
D(("e_fm_assoc_exec: fail (%s)\n", app));
|
||||
return 0;
|
||||
}
|
||||
/*
|
||||
* ecore_exe_tag_set(exe, "E/app");
|
||||
*/
|
||||
D(("e_fm_assoc_exec: ok (%s)\n", app));
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* local subsystem functions */
|
||||
static void
|
||||
_e_fm_file_free(E_Fm_File *file)
|
||||
|
|
|
@ -62,6 +62,7 @@ EAPI int e_fm_file_is_image (E_Fm_File *file);
|
|||
EAPI int e_fm_file_is_etheme (E_Fm_File *file);
|
||||
EAPI int e_fm_file_is_ebg (E_Fm_File *file);
|
||||
EAPI int e_fm_file_is_eap (E_Fm_File *file);
|
||||
EAPI int e_fm_file_can_exec (E_Fm_File *file);
|
||||
EAPI int e_fm_file_exec (E_Fm_File *file);
|
||||
EAPI int e_fm_file_assoc_set (E_Fm_File *file, const char *assoc);
|
||||
EAPI int e_fm_file_assoc_exec (E_Fm_File *file);
|
||||
|
|
|
@ -57,9 +57,6 @@ static Evas_List *event_handlers = NULL;
|
|||
int
|
||||
e_fm_icon_init(void)
|
||||
{
|
||||
char *homedir;
|
||||
char path[PATH_MAX];
|
||||
|
||||
event_handlers = evas_list_append(event_handlers,
|
||||
ecore_event_handler_add(ECORE_EVENT_EXE_EXIT,
|
||||
_e_fm_icon_thumb_cb_exe_exit,
|
||||
|
@ -443,7 +440,7 @@ _e_fm_icon_icon_mime_get(E_Smart_Data *sd)
|
|||
ext = strdup(ext);
|
||||
ext2 = ext;
|
||||
for (; *ext2; ext2++)
|
||||
*ext2 = (unsigned char)tolower((unsigned char)*ext2);
|
||||
*ext2 = tolower(*ext2);
|
||||
|
||||
snprintf(part, PATH_MAX, "fileman/icons/%s", (ext + 1));
|
||||
|
||||
|
@ -494,12 +491,11 @@ _e_fm_icon_thumb_cb_exe_exit(void *data, int type, void *event)
|
|||
sd = thumb_files->data;
|
||||
thumb_files = evas_list_remove_list(thumb_files, thumb_files);
|
||||
|
||||
ext = strrchr(sd->file->name, ".");
|
||||
if(ext)
|
||||
if(strcasecmp(ext, ".eap"))
|
||||
ext = strrchr(sd->file->name, '.');
|
||||
if ((ext) && (strcasecmp(ext, ".eap")))
|
||||
ext = NULL;
|
||||
|
||||
if (ecore_file_exists(sd->thumb_path) || ext)
|
||||
if ((ext) || (ecore_file_exists(sd->thumb_path)))
|
||||
{
|
||||
if (sd->image_object) evas_object_del(sd->image_object);
|
||||
sd->image_object = e_thumb_evas_object_get(sd->file->path,
|
||||
|
|
|
@ -70,7 +70,6 @@ struct _E_Fm_Config
|
|||
{
|
||||
int width;
|
||||
int height;
|
||||
Evas_List *apps;
|
||||
};
|
||||
|
||||
struct _E_Fm_Icon
|
||||
|
@ -172,7 +171,6 @@ struct _E_Fm_Smart_Data
|
|||
|
||||
struct {
|
||||
E_Config_DD *main_edd;
|
||||
E_Config_DD *assoc_app_edd;
|
||||
E_Fm_Config *main;
|
||||
} conf;
|
||||
};
|
||||
|
@ -244,10 +242,6 @@ static Ecore_Event_Handler *e_fm_mouse_up_handler = NULL;
|
|||
static double e_fm_grab_time = 0;
|
||||
static Evas_Smart *e_fm_smart = NULL;
|
||||
|
||||
|
||||
/* dummy for now */
|
||||
static int dummy_val;
|
||||
|
||||
/* externally accessible functions */
|
||||
int
|
||||
e_fm_init(void)
|
||||
|
@ -401,7 +395,7 @@ e_fm_freeze(Evas_Object *object)
|
|||
E_Fm_Smart_Data *sd;
|
||||
|
||||
if ((!object) || !(sd = evas_object_smart_data_get(object)))
|
||||
return;
|
||||
return -1;
|
||||
|
||||
sd->frozen++;
|
||||
evas_event_freeze(sd->evas);
|
||||
|
@ -415,7 +409,7 @@ e_fm_thaw(Evas_Object *object)
|
|||
E_Fm_Smart_Data *sd;
|
||||
|
||||
if ((!object) || !(sd = evas_object_smart_data_get(object)))
|
||||
return;
|
||||
return -1;
|
||||
|
||||
if (!sd->frozen) return 0;
|
||||
|
||||
|
@ -506,21 +500,13 @@ _e_fm_smart_add(Evas_Object *object)
|
|||
sd->position = 0.0;
|
||||
|
||||
sd->conf.main_edd = E_CONFIG_DD_NEW("E_Fm_Config", E_Fm_Config);
|
||||
sd->conf.assoc_app_edd = E_CONFIG_DD_NEW("E_Fm_Assoc_App",E_Fm_Assoc_App);
|
||||
|
||||
#undef T
|
||||
#undef DD
|
||||
#define T E_Fm_Assoc_App
|
||||
#define DD sd->conf.assoc_app_edd
|
||||
E_CONFIG_VAL(DD, T, mime, STR);
|
||||
E_CONFIG_VAL(DD, T, app, STR);
|
||||
#undef T
|
||||
#undef DD
|
||||
#define T E_Fm_Config
|
||||
#define DD sd->conf.main_edd
|
||||
E_CONFIG_VAL(DD, T, width, INT);
|
||||
E_CONFIG_VAL(DD, T, height, INT);
|
||||
E_CONFIG_LIST(DD, T, apps, sd->conf.assoc_app_edd);
|
||||
|
||||
sd->conf.main = e_config_domain_load("efm", sd->conf.main_edd);
|
||||
if (!sd->conf.main)
|
||||
|
@ -529,29 +515,6 @@ _e_fm_smart_add(Evas_Object *object)
|
|||
sd->conf.main = E_NEW(E_Fm_Config, 1);
|
||||
sd->conf.main->width = 640;
|
||||
sd->conf.main->height = 480;
|
||||
sd->conf.main->apps = NULL;
|
||||
|
||||
|
||||
/* some test values not meant for everyone */
|
||||
|
||||
{
|
||||
E_Fm_Assoc_App *assoc;
|
||||
|
||||
assoc = E_NEW(E_Fm_Assoc_App, 1);
|
||||
assoc->mime = (char*)E_NEW(char *, 5);
|
||||
snprintf(assoc->mime, 5, "%s", ".jpg");
|
||||
assoc->app = (char*)E_NEW(char *, 7);
|
||||
snprintf(assoc->app, 7, "gqview");
|
||||
sd->conf.main->apps = evas_list_append(sd->conf.main->apps, assoc);
|
||||
|
||||
assoc = E_NEW(E_Fm_Assoc_App, 1);
|
||||
assoc->mime = (char*)E_NEW(char *, 5);
|
||||
snprintf(assoc->mime, 5, "%s", ".png");
|
||||
assoc->app = (char*)E_NEW(char *, 7);
|
||||
snprintf(assoc->app, 7, "gqview");
|
||||
sd->conf.main->apps = evas_list_append(sd->conf.main->apps, assoc);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
evas_object_smart_data_set(object, sd);
|
||||
|
@ -564,7 +527,6 @@ static void
|
|||
_e_fm_smart_del(Evas_Object *object)
|
||||
{
|
||||
E_Fm_Smart_Data *sd;
|
||||
Evas_List *l;
|
||||
|
||||
if ((!object) || !(sd = evas_object_smart_data_get(object)))
|
||||
return;
|
||||
|
@ -804,7 +766,7 @@ _e_fm_file_menu_open(void *data, E_Menu *m, E_Menu_Item *mi)
|
|||
_e_fm_dir_set(icon->sd, icon->file->path);
|
||||
break;
|
||||
case E_FM_FILE_TYPE_FILE:
|
||||
if ((!e_fm_assoc_exec(icon->sd, icon->file->path) && (e_fm_file_can_exec(icon->file))))
|
||||
if ((!e_fm_file_assoc_exec(icon->file) && (e_fm_file_can_exec(icon->file))))
|
||||
e_fm_file_exec(icon->file);
|
||||
break;
|
||||
default:
|
||||
|
@ -967,22 +929,25 @@ _e_fm_icon_prop_create_data(E_Config_Dialog *cfd)
|
|||
E_Fm_Icon_CFData *cfdata;
|
||||
|
||||
cfdata = E_NEW(E_Fm_Icon_CFData, 1);
|
||||
if (!cfdata) return NULL;
|
||||
cfdata->icon = cfd->data;
|
||||
_e_fm_icon_prop_fill_data(cfdata);
|
||||
return cfdata;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_fm_icon_prop_free_data(E_Config_Dialog *cfd, E_Fm_Icon_CFData *cfdata)
|
||||
_e_fm_icon_prop_free_data(E_Config_Dialog *cfd, void *data)
|
||||
{
|
||||
free(cfdata);
|
||||
free(data);
|
||||
}
|
||||
|
||||
static int
|
||||
_e_fm_icon_prop_basic_apply_data(E_Config_Dialog *cfd, E_Fm_Icon_CFData *cfdata)
|
||||
_e_fm_icon_prop_basic_apply_data(E_Config_Dialog *cfd, void *data)
|
||||
{
|
||||
E_Fm_Icon *icon;
|
||||
E_Fm_Icon_CFData *cfdata;
|
||||
|
||||
cfdata = data;
|
||||
icon = cfdata->icon;
|
||||
|
||||
switch (cfdata->readwrite)
|
||||
|
@ -1019,10 +984,12 @@ _e_fm_icon_prop_basic_apply_data(E_Config_Dialog *cfd, E_Fm_Icon_CFData *cfdata)
|
|||
}
|
||||
|
||||
static int
|
||||
_e_fm_icon_prop_advanced_apply_data(E_Config_Dialog *cfd, E_Fm_Icon_CFData *cfdata)
|
||||
_e_fm_icon_prop_advanced_apply_data(E_Config_Dialog *cfd, void *data)
|
||||
{
|
||||
E_Fm_Icon *icon;
|
||||
E_Fm_Icon_CFData *cfdata;
|
||||
|
||||
cfdata = data;
|
||||
icon = cfdata->icon;
|
||||
|
||||
if(cfdata->user.r)
|
||||
|
@ -1070,40 +1037,33 @@ _e_fm_icon_prop_advanced_apply_data(E_Config_Dialog *cfd, E_Fm_Icon_CFData *cfda
|
|||
}
|
||||
|
||||
static Evas_Object *
|
||||
_e_fm_icon_prop_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Fm_Icon_CFData *cfdata)
|
||||
_e_fm_icon_prop_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, void *data)
|
||||
{
|
||||
E_Fm_Icon *icon;
|
||||
E_Win *win;
|
||||
Evas_Object *table;
|
||||
Evas_Object *name;
|
||||
Evas_Coord w, h;
|
||||
E_Fm_Icon_CFData *cfdata;
|
||||
struct group *grp;
|
||||
struct passwd *usr;
|
||||
struct tm *t;
|
||||
char *fullname;
|
||||
char *size, *username, *groupname, *lastaccess, *lastmod, *permissions;
|
||||
char text[512];
|
||||
E_Dialog *dia;
|
||||
Evas_Object *o, *ol, *hb;
|
||||
Evas_Coord mw, mh;
|
||||
Evas_Object *o, *ol;
|
||||
E_Radio_Group *rg;
|
||||
|
||||
cfdata = data;
|
||||
icon = cfdata->icon;
|
||||
|
||||
_e_fm_icon_prop_fill_data(cfdata);
|
||||
|
||||
size = E_NEW(char, 64);
|
||||
snprintf(size, 64, "%d", icon->file->size / 1024);
|
||||
snprintf(size, 64, "%ld", icon->file->size / 1024);
|
||||
|
||||
username = E_NEW(char, 128); // max length of username?
|
||||
usr = getpwuid(icon->file->owner);
|
||||
snprintf(username, 128, "%s", usr->pw_name);
|
||||
//free(usr);
|
||||
|
||||
groupname = E_NEW(char, 128); // max length of group?
|
||||
grp = getgrgid(icon->file->group);
|
||||
snprintf(groupname, 128, "%s", grp->gr_name);
|
||||
//free(grp);
|
||||
|
||||
t = gmtime(&icon->file->atime);
|
||||
lastaccess = E_NEW(char, 128);
|
||||
|
@ -1175,16 +1135,17 @@ _e_fm_icon_prop_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Fm_Icon
|
|||
}
|
||||
|
||||
static Evas_Object *
|
||||
_e_fm_icon_prop_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Fm_Icon_CFData *cfdata)
|
||||
_e_fm_icon_prop_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, void *data)
|
||||
{
|
||||
Evas_Object *o, *ob, *of;
|
||||
E_Radio_Group *rg;
|
||||
E_Fm_Icon *icon;
|
||||
E_Fm_Icon_CFData *cfdata;
|
||||
struct group *grp;
|
||||
struct passwd *usr;
|
||||
struct tm *t;
|
||||
char *lastaccess, *lastmod;
|
||||
|
||||
cfdata = data;
|
||||
icon = cfdata->icon;
|
||||
|
||||
_e_fm_icon_prop_fill_data(cfdata);
|
||||
|
@ -1376,17 +1337,14 @@ _e_fm_dir_set(E_Fm_Smart_Data *sd, const char *dir)
|
|||
for (l = sd->files; l; l = l->next)
|
||||
{
|
||||
E_Fm_Icon *icon;
|
||||
Evas_Coord icon_w, icon_h;
|
||||
|
||||
icon = l->data;
|
||||
|
||||
{
|
||||
Evas_Coord icon_w, icon_h;
|
||||
|
||||
evas_object_resize(icon->icon_object, sd->icon_info.w, sd->icon_info.h);
|
||||
evas_object_show(icon->icon_object);
|
||||
evas_object_geometry_get(icon->icon_object, NULL, NULL, &icon_w, &icon_h);
|
||||
D(("_e_fm_dir_set: Icon, w=%d h=%d\n", icon_w, icon_h));
|
||||
}
|
||||
|
||||
e_icon_layout_pack(sd->layout, icon->icon_object);
|
||||
|
||||
|
@ -1912,8 +1870,8 @@ _e_fm_icon_mouse_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info
|
|||
{
|
||||
icon->sd->drag.start = 0;
|
||||
|
||||
if(!e_fm_assoc_exec(icon->sd, icon->file->path))
|
||||
if (e_fm_file_can_exec(icon->file))
|
||||
if ((!e_fm_file_assoc_exec(icon->file)) &&
|
||||
(e_fm_file_can_exec(icon->file)))
|
||||
e_fm_file_exec(icon->file);
|
||||
}
|
||||
else
|
||||
|
@ -2104,7 +2062,6 @@ _e_fm_win_mouse_move_cb(void *data, int type, void *event)
|
|||
Evas_Coord x, y, w, h;
|
||||
int cx, cy;
|
||||
char data[PATH_MAX];
|
||||
const char *path = NULL, *part = NULL;
|
||||
const char *drop_types[] = { "text/uri-list" };
|
||||
|
||||
snprintf(data, sizeof(data), "file://%s", icon->file->path);
|
||||
|
@ -2120,26 +2077,6 @@ _e_fm_win_mouse_move_cb(void *data, int type, void *event)
|
|||
e_fm_icon_title_set(o, "");
|
||||
evas_object_resize(o, w, h);
|
||||
|
||||
/* This shouldnt be needed anymore
|
||||
edje_object_file_get(icon->icon_object, &path, &part);
|
||||
if ((path) && (part))
|
||||
{
|
||||
o = edje_object_add(drag->evas);
|
||||
edje_object_file_set(o, path, part);
|
||||
}
|
||||
else
|
||||
{
|
||||
int iw, ih;
|
||||
|
||||
o = evas_object_image_add(drag->evas);
|
||||
evas_object_image_size_get(icon->icon_object, &iw, &ih);
|
||||
evas_object_image_size_set(o, iw, ih);
|
||||
evas_object_image_data_copy_set(o, evas_object_image_data_get(icon->icon_object, 0));
|
||||
evas_object_image_data_update_add(o, 0, 0, iw, ih);
|
||||
evas_object_image_fill_set(o, 0, 0, iw, ih);
|
||||
evas_object_resize(o, iw, ih);
|
||||
}
|
||||
*/
|
||||
if (!o)
|
||||
{
|
||||
// FIXME: fallback icon for drag
|
||||
|
@ -2310,47 +2247,3 @@ _e_fm_files_sort_modtime_cb(void *d1, void *d2)
|
|||
|
||||
return (e1->file->mtime > e2->file->mtime);
|
||||
}
|
||||
|
||||
/* associations / mime type functions */
|
||||
int
|
||||
e_fm_assoc_exec( E_Fm_Smart_Data *sd, char *file)
|
||||
{
|
||||
char app[PATH_MAX * 2];
|
||||
Evas_List *l;
|
||||
E_Fm_Assoc_App *assoc;
|
||||
Ecore_Exe *exe;
|
||||
|
||||
for (l = sd->conf.main->apps; l; l = l->next)
|
||||
{
|
||||
char *ext;
|
||||
|
||||
assoc = l->data;
|
||||
ext = strrchr(file, '.');
|
||||
if(ext)
|
||||
if(!strcasecmp(ext, assoc->mime))
|
||||
break;
|
||||
assoc = NULL;
|
||||
}
|
||||
|
||||
if(!assoc) return 0;
|
||||
|
||||
snprintf(app, PATH_MAX * 2, "%s %s", assoc->app, file);
|
||||
exe = ecore_exe_run(app, NULL);
|
||||
|
||||
if (!exe)
|
||||
{
|
||||
e_error_dialog_show(_("Run Error"),
|
||||
_("Enlightenment was unable fork a child process:\n"
|
||||
"\n"
|
||||
"%s\n"
|
||||
"\n"),
|
||||
app);
|
||||
D(("e_fm_assoc_exec: fail (%s)\n", app));
|
||||
return 0;
|
||||
}
|
||||
/*
|
||||
* ecore_exe_tag_set(exe, "E/app");
|
||||
*/
|
||||
D(("e_fm_assoc_exec: ok (%s)\n", app));
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
typedef struct _E_Event_Fm_Reconfigure E_Event_Fm_Reconfigure;
|
||||
typedef struct _E_Event_Fm_Directory_Change E_Event_Fm_Directory_Change;
|
||||
typedef struct _E_Fm_Assoc_App E_Fm_Assoc_App;
|
||||
|
||||
#else
|
||||
#ifndef E_FM_SMART_H
|
||||
|
@ -23,12 +22,6 @@ struct _E_Event_Fm_Directory_Change
|
|||
Evas_Coord w, h;
|
||||
};
|
||||
|
||||
struct _E_Fm_Assoc_App
|
||||
{
|
||||
char *mime;
|
||||
char *app;
|
||||
};
|
||||
|
||||
EAPI int e_fm_init(void);
|
||||
EAPI int e_fm_shutdown(void);
|
||||
EAPI Evas_Object *e_fm_add(Evas *evas);
|
||||
|
|
|
@ -42,10 +42,10 @@ e_thumb_shutdown(void)
|
|||
}
|
||||
|
||||
/* return dir where thumbs are saved */
|
||||
char *
|
||||
const char *
|
||||
e_thumb_dir_get(void)
|
||||
{
|
||||
return strdup(thumb_path);
|
||||
return thumb_path;
|
||||
}
|
||||
|
||||
/* return hashed path of thumb */
|
||||
|
@ -56,7 +56,7 @@ e_thumb_file_get(char *file)
|
|||
char thumb[PATH_MAX];
|
||||
|
||||
id = _e_thumb_file_id(file);
|
||||
if(!id) { return NULL; }
|
||||
if (!id) return NULL;
|
||||
snprintf(thumb, sizeof(thumb), "%s/%s", thumb_path, id);
|
||||
free(id);
|
||||
return strdup(thumb);
|
||||
|
@ -70,8 +70,7 @@ e_thumb_exists(char *file)
|
|||
char *ext;
|
||||
|
||||
ext = strrchr(file, '.');
|
||||
if(ext)
|
||||
if(!strcasecmp(ext, ".eap"))
|
||||
if ((ext) && (!strcasecmp(ext, ".eap")))
|
||||
return 1;
|
||||
|
||||
thumb = e_thumb_file_get(file);
|
||||
|
@ -80,7 +79,6 @@ e_thumb_exists(char *file)
|
|||
free(thumb);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -137,7 +135,6 @@ _e_thumb_ebg_create(char *file, Evas_Coord w, Evas_Coord h, int *ww, int *hh, in
|
|||
|
||||
wallpaper = edje_object_add(evasbuf);
|
||||
|
||||
|
||||
edje_object_file_set(wallpaper, file, "desktop/background");
|
||||
|
||||
/* wallpaper */
|
||||
|
@ -242,18 +239,12 @@ e_thumb_create(char *file, Evas_Coord w, Evas_Coord h)
|
|||
int alpha;
|
||||
|
||||
ext = strrchr(file, '.');
|
||||
if(ext)
|
||||
{
|
||||
if(!strcasecmp(ext, ".eap"))
|
||||
if ((ext) && (!strcasecmp(ext, ".eap")))
|
||||
return 1;
|
||||
}
|
||||
|
||||
thumbpath = e_thumb_file_get(file);
|
||||
if (!thumbpath)
|
||||
{
|
||||
free(thumbpath);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (ext)
|
||||
{
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
EAPI int e_thumb_init(void);
|
||||
EAPI int e_thumb_shutdown(void);
|
||||
EAPI char *e_thumb_dir_get(void);
|
||||
EAPI const char *e_thumb_dir_get(void);
|
||||
EAPI char *e_thumb_file_get(char *file);
|
||||
EAPI int e_thumb_exists(char *file);
|
||||
EAPI int e_thumb_create(char *file, Evas_Coord w, Evas_Coord h);
|
||||
|
|
Loading…
Reference in New Issue