From bf8b60dfceeb13159d1fcceeab7f963c0c8a56da Mon Sep 17 00:00:00 2001 From: Stafford Mitchell Horne Date: Sat, 27 Jan 2007 08:47:53 +0000 Subject: [PATCH] Get the imc icons in e_fm SVN revision: 28136 --- src/bin/e_fm.c | 44 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/src/bin/e_fm.c b/src/bin/e_fm.c index f02c490f3..5db360d5e 100644 --- a/src/bin/e_fm.c +++ b/src/bin/e_fm.c @@ -1045,7 +1045,8 @@ e_fm2_icon_get(Evas *evas, const char *realpath, else if (!strcmp(icon, "DESKTOP")) { E_App *app; - + + oic = NULL; if (ici->pseudo_link) snprintf(buf, sizeof(buf), "%s/%s", ici->pseudo_dir, ici->file); else @@ -1125,7 +1126,8 @@ e_fm2_icon_get(Evas *evas, const char *realpath, (e_util_glob_case_match(ici->file, "*.directory"))) { E_App *app; - + + oic = NULL; app = e_app_new(buf, 0); if (app) { @@ -1134,6 +1136,43 @@ e_fm2_icon_get(Evas *evas, const char *realpath, } if (type_ret) *type_ret = "DESKTOP"; } + else if (e_util_glob_case_match(ici->file, "*.imc")) + { + E_Input_Method_Config *imc; + Eet_File *imc_ef; + + oic = NULL; + imc_ef = eet_open(buf, EET_FILE_MODE_READ); + + if (imc_ef) + { + imc = e_intl_input_method_config_read(imc_ef); + eet_close(imc_ef); + + if (imc->e_im_setup_exec) + { + E_App *app; + app = e_app_exe_find(imc->e_im_setup_exec); + if (app) + { + oic = e_app_icon_add(app, evas); + } + } + e_intl_input_method_config_free(imc); + } + + if (oic == NULL) + { + oic = edje_object_add(evas); + e_theme_edje_object_set(oic, "base/theme/fileman", + "e/icons/fileman/file"); + if (type_ret) *type_ret = "FILE_TYPE"; + } + else + { + if (type_ret) *type_ret = "IMC"; + } + } else if (S_ISCHR(ici->statinfo.st_mode)) { oic = edje_object_add(evas); @@ -2279,7 +2318,6 @@ static Evas_Object * _e_fm2_icon_icon_direct_set(E_Fm2_Icon *ic, Evas_Object *o, void (*gen_func) (void *data, Evas_Object *obj, void *event_info), void *data, int force_gen) { Evas_Object *oic; - char buf[4096], *p; oic = e_fm2_icon_get(evas_object_evas_get(o), ic->sd->realpath, ic, &(ic->info), ic->sd->config->icon.key_hint,