input method conf dialog - fix filtering of imc's to search path

if exe is not a full path it'd be filtered out... so fix and do a path
search to show imc's that can work.

@fix
This commit is contained in:
Carsten Haitzler 2018-05-15 15:36:45 +09:00 committed by Mike Blumenkrantz
parent 5cb6e1e8fa
commit 2c52afb6f4
1 changed files with 36 additions and 3 deletions

View File

@ -347,10 +347,43 @@ _basic_create_widgets(E_Config_Dialog *cfd EINA_UNUSED, Evas *evas, E_Config_Dia
{
Efreet_Desktop *desktop;
if (!ecore_file_exists(imc->e_im_setup_exec))
if (imc->e_im_setup_exec[0] == '/')
{
e_intl_input_method_config_free(imc);
goto out;
if (!ecore_file_exists(imc->e_im_setup_exec))
{
e_intl_input_method_config_free(imc);
goto out;
}
}
else
{
const char *env = getenv("PATH");
char **split, buf[PATH_MAX];
Eina_Bool exec_found = EINA_FALSE;
if (!env)
{
e_intl_input_method_config_free(imc);
goto out;
}
split = eina_str_split(env, ":", 0);
for (i = 0; split[i] != NULL; i++)
{
snprintf(buf, sizeof(buf), "%s/%s", split[i], imc->e_im_setup_exec);
if (ecore_file_exists(buf) && ecore_file_can_exec(buf))
{
exec_found = EINA_TRUE;
break;
}
}
free(split[0]);
free(split);
if (!exec_found)
{
e_intl_input_method_config_free(imc);
goto out;
}
}
desktop = efreet_util_desktop_exec_find(imc->e_im_setup_exec);
if (desktop)