Use efreet to get information about .desktop files.

SVN revision: 29038
This commit is contained in:
Sebastian Dransfeld 2007-03-24 19:18:20 +00:00
parent e25c2ffdec
commit c7872bf9f7
4 changed files with 28 additions and 26 deletions

View File

@ -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;
Efreet_Desktop *ef;
oic = NULL;
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 (e_util_glob_case_match(ici->file, "*.imc"))

View File

@ -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;

View File

@ -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)

View File

@ -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