diff --git a/src/bin/e_fm.c b/src/bin/e_fm.c index 5190f081a..ecbd45557 100644 --- a/src/bin/e_fm.c +++ b/src/bin/e_fm.c @@ -976,16 +976,12 @@ e_fm2_icon_get(Evas *evas, const char *realpath, } else if (!strcmp(icon, "DESKTOP")) { - E_App *app; + Efreet_Desktop *ef; oic = NULL; snprintf(buf, sizeof(buf), "%s/%s", realpath, ici->file); - app = e_app_new(buf, 0); - if (app) - { - oic = e_app_icon_add(app, evas); - e_object_unref(E_OBJECT(app)); - } + ef = efreet_desktop_get(buf); + if (ef) oic = e_util_desktop_icon_add(ef, "24x24", evas); if (type_ret) *type_ret = "DESKTOP"; } else if (!strncmp(icon, "e/icons/fileman/mime/", 21)) @@ -1021,9 +1017,7 @@ e_fm2_icon_get(Evas *evas, const char *realpath, { snprintf(buf, sizeof(buf), "%s/%s", realpath, ici->file); /* fallback */ - if ( - (e_util_glob_case_match(ici->file, "*.edj")) - ) + if ((e_util_glob_case_match(ici->file, "*.edj"))) { oic = e_thumb_icon_add(evas); if (keyhint) @@ -1051,15 +1045,11 @@ e_fm2_icon_get(Evas *evas, const char *realpath, else if ((e_util_glob_case_match(ici->file, "*.desktop")) || (e_util_glob_case_match(ici->file, "*.directory"))) { - E_App *app; - - oic = NULL; - app = e_app_new(buf, 0); - if (app) - { - oic = e_app_icon_add(app, evas); - e_object_unref(E_OBJECT(app)); - } + Efreet_Desktop *ef; + + oic = NULL; + ef = efreet_desktop_get(buf); + if (ef) oic = e_util_desktop_icon_add(ef, "24x24", evas); if (type_ret) *type_ret = "DESKTOP"; } else if (e_util_glob_case_match(ici->file, "*.imc")) diff --git a/src/bin/e_int_config_imc.c b/src/bin/e_int_config_imc.c index a52b6a7a6..10bb04575 100644 --- a/src/bin/e_int_config_imc.c +++ b/src/bin/e_int_config_imc.c @@ -225,15 +225,11 @@ _e_imc_setup_button_toggle(Evas_Object *button, E_Input_Method_Config *imc) { int flag; - flag = ( imc->e_im_setup_exec == NULL ) || - ( imc->e_im_setup_exec[0] == 0 ); + flag = (!imc->e_im_setup_exec) || (!imc->e_im_setup_exec[0]); e_widget_disabled_set(button, flag); } else - { - e_widget_disabled_set(button, 1); - } - + e_widget_disabled_set(button, 1); } static void @@ -264,7 +260,7 @@ _e_imc_setup_cb(void *data, void *data2) imc = evas_hash_find(cfdata->imc_basic_map, cfdata->imc_current); - if (imc && imc->e_im_setup_exec) + if ((imc) && (imc->e_im_setup_exec)) { Ecore_Exe *exe; const char *cmd; diff --git a/src/bin/e_utils.c b/src/bin/e_utils.c index 427a33e13..e585c1b55 100644 --- a/src/bin/e_utils.c +++ b/src/bin/e_utils.c @@ -846,6 +846,21 @@ e_util_icon_add(const char *path, Evas *evas) return o; } +EAPI Evas_Object * +e_util_desktop_icon_add(Efreet_Desktop *desktop, const char *size, Evas *evas) +{ + if ((!desktop) || (!desktop->icon)) return NULL; + + if (desktop->icon[0] == '/') return e_util_icon_add(desktop->icon, evas); + else + { + const char *path; + path = efreet_icon_path_find(e_config->icon_theme, desktop->icon, size); + if (path) return e_util_icon_add(path, evas); + } + return NULL; +} + /* local subsystem functions */ static void _e_util_container_fake_mouse_up_cb(void *data) diff --git a/src/bin/e_utils.h b/src/bin/e_utils.h index 58c864317..14a3e3a19 100644 --- a/src/bin/e_utils.h +++ b/src/bin/e_utils.h @@ -50,6 +50,7 @@ EAPI char *e_util_file_time_get(time_t ftime); EAPI void e_util_library_path_strip(void); EAPI void e_util_library_path_restore(void); EAPI Evas_Object *e_util_icon_add(const char *path, Evas *evas); +EAPI Evas_Object *e_util_desktop_icon_add(Efreet_Desktop *desktop, const char *size, Evas *evas); #endif #endif