simplify Open Terminal Here callback

SVN revision: 76183
This commit is contained in:
Mike Blumenkrantz 2012-09-05 09:44:23 +00:00
parent bdab9a3b16
commit ca23ccf990
1 changed files with 10 additions and 16 deletions

View File

@ -1878,27 +1878,21 @@ _e_fwin_terminal(void *data,
{ {
E_Fwin *fwin = data; E_Fwin *fwin = data;
Efreet_Desktop *tdesktop; Efreet_Desktop *tdesktop;
char buf[PATH_MAX];
const char *path;
if (!fwin->cur_page) return; if (!fwin->cur_page) return;
if (!getcwd(buf, sizeof(buf))) return;
tdesktop = e_util_terminal_desktop_get(); tdesktop = e_util_terminal_desktop_get();
if (tdesktop) if (!tdesktop) return;
path = e_fm2_real_path_get(fwin->cur_page->fm_obj);
if (path)
{ {
char buf[PATH_MAX]; chdir(path);
e_exec(fwin->zone, tdesktop, NULL, NULL, "fileman");
if (getcwd(buf, sizeof(buf))) chdir(buf);
{
const char *path;
path = e_fm2_real_path_get(fwin->cur_page->fm_obj);
if (path)
{
chdir(path);
e_exec(fwin->zone, tdesktop, NULL, NULL, "fileman");
chdir(buf);
}
}
efreet_desktop_free(tdesktop);
} }
efreet_desktop_free(tdesktop);
} }
static void static void