Enlightenment CVS committal Author : englebass Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_fm.c e_int_config_imc.c e_utils.c e_utils.h Log Message: Use efreet to get information about .desktop files. =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_fm.c,v retrieving revision 1.134 retrieving revision 1.135 diff -u -3 -r1.134 -r1.135 --- e_fm.c 24 Mar 2007 09:54:23 -0000 1.134 +++ e_fm.c 24 Mar 2007 19:18:20 -0000 1.135 @@ -976,16 +976,12 @@ } 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 @@ { 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 @@ 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")) =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_imc.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- e_int_config_imc.c 2 Mar 2007 17:00:20 -0000 1.13 +++ e_int_config_imc.c 24 Mar 2007 19:18:20 -0000 1.14 @@ -225,15 +225,11 @@ { 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 @@ 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; =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_utils.c,v retrieving revision 1.60 retrieving revision 1.61 diff -u -3 -r1.60 -r1.61 --- e_utils.c 24 Mar 2007 12:55:30 -0000 1.60 +++ e_utils.c 24 Mar 2007 19:18:20 -0000 1.61 @@ -846,6 +846,21 @@ 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) =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_utils.h,v retrieving revision 1.31 retrieving revision 1.32 diff -u -3 -r1.31 -r1.32 --- e_utils.h 24 Mar 2007 09:25:32 -0000 1.31 +++ e_utils.h 24 Mar 2007 19:18:20 -0000 1.32 @@ -50,6 +50,7 @@ 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 ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs