From 6d4c3828af6be6b9eba1abd328cc16bad434fa7e Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Fri, 19 Oct 2012 10:58:55 +0300 Subject: [PATCH] move do_load_prompt() and load_prompt() from src/main.c to src/filemanager/layout.c Signed-off-by: Slava Zanko --- src/filemanager/layout.c | 41 ++++++++++++++++++++++++++++++++++++++++ src/filemanager/layout.h | 5 +++++ src/main.c | 41 ---------------------------------------- src/main.h | 5 ----- 4 files changed, 46 insertions(+), 46 deletions(-) diff --git a/src/filemanager/layout.c b/src/filemanager/layout.c index c8fa921d5..7cb1b463d 100644 --- a/src/filemanager/layout.c +++ b/src/filemanager/layout.c @@ -1287,3 +1287,44 @@ get_panel_dir_for (const WPanel * widget) } /* --------------------------------------------------------------------------------------------- */ + +#ifdef HAVE_SUBSHELL_SUPPORT +gboolean +do_load_prompt (void) +{ + gboolean ret = FALSE; + + if (!read_subshell_prompt ()) + return ret; + + /* Don't actually change the prompt if it's invisible */ + if (top_dlg != NULL && ((Dlg_head *) top_dlg->data == midnight_dlg) && command_prompt) + { + setup_cmdline (); + + /* since the prompt has changed, and we are called from one of the + * tty_get_event channels, the prompt updating does not take place + * automatically: force a cursor update and a screen refresh + */ + update_cursor (midnight_dlg); + mc_refresh (); + ret = TRUE; + } + update_subshell_prompt = TRUE; + return ret; +} + +/* --------------------------------------------------------------------------------------------- */ + +int +load_prompt (int fd, void *unused) +{ + (void) fd; + (void) unused; + + do_load_prompt (); + return 0; +} +#endif /* HAVE_SUBSHELL_SUPPORT */ + +/* --------------------------------------------------------------------------------------------- */ diff --git a/src/filemanager/layout.h b/src/filemanager/layout.h index 148543fe7..aea7483a6 100644 --- a/src/filemanager/layout.h +++ b/src/filemanager/layout.h @@ -81,6 +81,11 @@ void set_hintbar (const char *str); void use_dash (gboolean flag); /* Disable/Enable rotate_dash routines */ void rotate_dash (void); +#ifdef HAVE_SUBSHELL_SUPPORT +gboolean do_load_prompt (void); +int load_prompt (int fd, void *unused); +#endif + /*** inline functions ****************************************************************************/ #endif /* MC__LAYOUT_H */ diff --git a/src/main.c b/src/main.c index 4222a5eef..a09ade142 100644 --- a/src/main.c +++ b/src/main.c @@ -274,47 +274,6 @@ init_sigchld (void) /*** public functions ****************************************************************************/ /* --------------------------------------------------------------------------------------------- */ -#ifdef HAVE_SUBSHELL_SUPPORT -gboolean -do_load_prompt (void) -{ - gboolean ret = FALSE; - - if (!read_subshell_prompt ()) - return ret; - - /* Don't actually change the prompt if it's invisible */ - if (top_dlg != NULL && ((Dlg_head *) top_dlg->data == midnight_dlg) && command_prompt) - { - setup_cmdline (); - - /* since the prompt has changed, and we are called from one of the - * tty_get_event channels, the prompt updating does not take place - * automatically: force a cursor update and a screen refresh - */ - update_cursor (midnight_dlg); - mc_refresh (); - ret = TRUE; - } - update_subshell_prompt = TRUE; - return ret; -} - -/* --------------------------------------------------------------------------------------------- */ - -int -load_prompt (int fd, void *unused) -{ - (void) fd; - (void) unused; - - do_load_prompt (); - return 0; -} -#endif /* HAVE_SUBSHELL_SUPPORT */ - -/* --------------------------------------------------------------------------------------------- */ - void title_path_prepare (char **path, char **login) { diff --git a/src/main.h b/src/main.h index e363ca7ae..b5f6df017 100644 --- a/src/main.h +++ b/src/main.h @@ -85,11 +85,6 @@ extern GArray *macros_list; /*** declarations of public functions ************************************************************/ -#ifdef HAVE_SUBSHELL_SUPPORT -gboolean do_load_prompt (void); -int load_prompt (int fd, void *unused); -#endif - void update_xterm_title_path (void); void title_path_prepare (char **path, char **login);