(cd_box): get rid of global variable current_panel usage.

(quick_cd_cmd): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2020-08-19 20:51:13 +03:00
parent 7fefe1874a
commit 4bae23495a
5 changed files with 8 additions and 9 deletions

View File

@ -73,10 +73,9 @@
#include "command.h" /* For cmdline */
#include "dir.h"
#include "panel.h" /* LIST_FORMATS */
#include "tree.h"
#include "layout.h" /* for get_nth_panel_name proto */
#include "filemanager.h" /* current_panel */
#include "filemanager.h"
#include "boxes.h"
@ -1196,9 +1195,9 @@ configure_vfs_box (void)
/* --------------------------------------------------------------------------------------------- */
char *
cd_box (void)
cd_box (const WPanel * panel)
{
const Widget *w = CONST_WIDGET (current_panel);
const Widget *w = CONST_WIDGET (panel);
char *my_str;
quick_widget_t quick_widgets[] = {

View File

@ -28,7 +28,7 @@ void confirm_box (void);
void display_bits_box (void);
void configure_vfs_box (void);
void jobs_box (void);
char *cd_box (void);
char *cd_box (const WPanel * panel);
void symlink_box (const vfs_path_t * existing_vpath, const vfs_path_t * new_vpath,
char **ret_existing, char **ret_new);
char *tree_box (const char *current_dir);

View File

@ -1352,11 +1352,11 @@ undelete_cmd (void)
/* --------------------------------------------------------------------------------------------- */
void
quick_cd_cmd (void)
quick_cd_cmd (WPanel * panel)
{
char *p;
p = cd_box ();
p = cd_box (panel);
if (p != NULL && *p != '\0')
{
char *q;

View File

@ -81,7 +81,7 @@ void panel_tree_cmd (void);
void link_cmd (link_type_t link_type);
void edit_symlink_cmd (void);
void swap_cmd (void);
void quick_cd_cmd (void);
void quick_cd_cmd (WPanel * panel);
void save_setup_cmd (void);
void user_file_menu_cmd (void);
void info_cmd (void);

View File

@ -1328,7 +1328,7 @@ midnight_execute_cmd (Widget * sender, long command)
break;
#endif
case CK_CdQuick:
quick_cd_cmd ();
quick_cd_cmd (current_panel);
break;
case CK_HotList:
hotlist_cmd ();