oof a nast old bug lurking in e_apps for execcing - if the app is NOT in the

all apps repo. fixed.


SVN revision: 26856
This commit is contained in:
Carsten Haitzler 2006-10-29 10:29:45 +00:00
parent 3cac21c264
commit 1e9fb6d3aa
3 changed files with 55 additions and 37 deletions

View File

@ -697,9 +697,12 @@ e_app_exec(E_App *a, int launch_id)
inst->launch_id = launch_id;
inst->launch_time = ecore_time_get();
inst->expire_timer = ecore_timer_add(10.0, _e_app_cb_expire_timer, inst);
_e_apps_all->subapps = evas_list_remove(_e_apps_all->subapps, original);
_e_apps_all->subapps = evas_list_prepend(_e_apps_all->subapps, original);
if (original->parent == _e_apps_all)
{
_e_apps_all->subapps = evas_list_remove(_e_apps_all->subapps, original);
_e_apps_all->subapps = evas_list_prepend(_e_apps_all->subapps, original);
}
original->instances = evas_list_append(original->instances, inst);
_e_apps_start_pending = evas_list_append(_e_apps_start_pending, original);

View File

@ -529,6 +529,11 @@ _e_fwin_file_is_exec(E_Fm2_Icon_Info *ici)
return E_FWIN_EXEC_SH;
}
}
else if ((e_util_glob_match(ici->file, "*.desktop")) ||
(e_util_glob_match(ici->file, "*.kdelink")))
{
return E_FWIN_EXEC_DESKTOP;
}
}
return E_FWIN_EXEC_NONE;
}
@ -562,7 +567,11 @@ _e_fwin_file_exec(E_Fwin *fwin, E_Fm2_Icon_Info *ici, E_Fwin_Exec_Type ext)
e_zone_exec(fwin->win->border->zone, buf);
break;
case E_FWIN_EXEC_DESKTOP:
a = e_app_new(ici->file, 0);
if (ici->pseudo_link)
snprintf(buf, sizeof(buf), "%s/%s", ici->pseudo_dir, ici->file);
else
snprintf(buf, sizeof(buf), "%s/%s", e_fm2_real_path_get(fwin->fm_obj), ici->file);
a = e_app_new(buf, 0);
if (a)
{
e_zone_app_exec(fwin->win->border->zone, a);
@ -693,34 +702,39 @@ _e_fwin_file_open_dialog(E_Fwin *fwin, Evas_List *files, int always)
* use it, if not fall back again - and so on - if all apps listed do
* not contain 1 that handles all the mime types - fall back to dialog
*/
if (evas_list_count(mlist) == 1)
if (evas_list_count(mlist) <= 1)
{
a = e_exehist_mime_app_get(mlist->data);
char pcwd[4096], buf[4096], *cmd;
Ecore_List *files_list = NULL, *cmds = NULL;
need_dia = 1;
a = NULL;
if (mlist) a = e_exehist_mime_app_get(mlist->data);
getcwd(pcwd, sizeof(pcwd));
chdir(e_fm2_real_path_get(fwin->fm_obj));
files_list = ecore_list_new();
ecore_list_set_free_cb(files_list, free);
for (l = files; l; l = l->next)
{
ici = l->data;
if (_e_fwin_file_is_exec(ici) == E_FWIN_EXEC_NONE)
ecore_list_append(files_list, strdup(ici->file));
}
for (l = files; l; l = l->next)
{
E_Fwin_Exec_Type ext;
ici = l->data;
ext = _e_fwin_file_is_exec(ici);
if (ext != E_FWIN_EXEC_NONE)
{
_e_fwin_file_exec(fwin, ici, ext);
need_dia = 0;
}
}
if (a)
{
char pcwd[4096], buf[4096], *cmd;
Ecore_List *files_list = NULL, *cmds = NULL;
getcwd(pcwd, sizeof(pcwd));
chdir(e_fm2_real_path_get(fwin->fm_obj));
files_list = ecore_list_new();
ecore_list_set_free_cb(files_list, free);
for (l = files; l; l = l->next)
{
ici = l->data;
if (_e_fwin_file_is_exec(ici) == E_FWIN_EXEC_NONE)
ecore_list_append(files_list, strdup(ici->file));
}
for (l = files; l; l = l->next)
{
E_Fwin_Exec_Type ext;
ici = l->data;
ext = _e_fwin_file_is_exec(ici);
if (ext != E_FWIN_EXEC_NONE)
_e_fwin_file_exec(fwin, ici, ext);
}
cmds = ecore_desktop_get_command(a->desktop, files_list, 1);
if (cmds)
{
@ -729,15 +743,18 @@ _e_fwin_file_open_dialog(E_Fwin *fwin, Evas_List *files, int always)
{
e_zone_exec(fwin->win->border->zone, cmd);
e_exehist_add("fwin", cmd);
need_dia = 0;
}
ecore_list_destroy(cmds);
}
ecore_list_destroy(files_list);
}
ecore_list_destroy(files_list);
chdir(pcwd);
if (!need_dia)
{
if (apps) evas_list_free(apps);
evas_list_free(mlist);
chdir(pcwd);
return;
}
}

View File

@ -673,9 +673,9 @@ e_zone_exec(E_Zone *zone, char *exe)
}
/* 20 lines at start and end, 20x100 limit on bytes at each end. */
ecore_exe_auto_limits_set(ex, 2000, 2000, 20, 20);
ecore_exe_tag_set(ex, "E/app");
if (a)
{
ecore_exe_tag_set(ex, "E/app");
inst->app = a;
inst->exe = ex;
inst->launch_id = startup_id;
@ -684,9 +684,7 @@ e_zone_exec(E_Zone *zone, char *exe)
if (a->startup_notify) a->starting = 1;
}
else
{
ecore_exe_free(ex);
}
ecore_exe_free(ex);
return ret;
}