From 615f29d7d5d636a48f0c32045f64e20471a2d93d Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 20 Jan 2019 12:07:27 +0300 Subject: [PATCH] (set_display_type): rename to create_panel. Signed-off-by: Andrew Borodin --- src/filemanager/cmd.c | 24 ++++++++++++------------ src/filemanager/layout.c | 4 ++-- src/filemanager/layout.h | 2 +- src/filemanager/midnight.c | 4 ++-- src/filemanager/panel.c | 4 ++-- src/filemanager/panelize.c | 2 +- src/viewer/actions_cmd.c | 4 ++-- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/filemanager/cmd.c b/src/filemanager/cmd.c index f80342799..00ead8b84 100644 --- a/src/filemanager/cmd.c +++ b/src/filemanager/cmd.c @@ -460,7 +460,7 @@ nice_cd (const char *text, const char *xtext, const char *help, save_type = get_display_type (MENU_PANEL_IDX); if (save_type != view_listing) - set_display_type (MENU_PANEL_IDX, view_listing); + create_panel (MENU_PANEL_IDX, view_listing); cd_vpath = vfs_path_from_str_flags (cd_path, VPF_NO_CANON); if (!do_panel_cd (MENU_PANEL, cd_vpath, cd_parse_command)) @@ -468,7 +468,7 @@ nice_cd (const char *text, const char *xtext, const char *help, message (D_ERROR, MSG_ERROR, _("Cannot chdir to \"%s\""), cd_path); if (save_type != view_listing) - set_display_type (MENU_PANEL_IDX, save_type); + create_panel (MENU_PANEL_IDX, save_type); } vfs_path_free (cd_vpath); } @@ -515,7 +515,7 @@ static void switch_to_listing (int panel_index) { if (get_display_type (panel_index) != view_listing) - set_display_type (panel_index, view_listing); + create_panel (panel_index, view_listing); } /* --------------------------------------------------------------------------------------------- */ @@ -1536,11 +1536,11 @@ void info_cmd_no_menu (void) { if (get_display_type (0) == view_info) - set_display_type (0, view_listing); + create_panel (0, view_listing); else if (get_display_type (1) == view_info) - set_display_type (1, view_listing); + create_panel (1, view_listing); else - set_display_type (current_panel == left_panel ? 1 : 0, view_info); + create_panel (current_panel == left_panel ? 1 : 0, view_info); } /* --------------------------------------------------------------------------------------------- */ @@ -1549,11 +1549,11 @@ void quick_cmd_no_menu (void) { if (get_display_type (0) == view_quick) - set_display_type (0, view_listing); + create_panel (0, view_listing); else if (get_display_type (1) == view_quick) - set_display_type (1, view_listing); + create_panel (1, view_listing); else - set_display_type (current_panel == left_panel ? 1 : 0, view_quick); + create_panel (current_panel == left_panel ? 1 : 0, view_quick); } /* --------------------------------------------------------------------------------------------- */ @@ -1601,7 +1601,7 @@ setup_listing_format_cmd (void) void panel_tree_cmd (void) { - set_display_type (MENU_PANEL_IDX, view_tree); + create_panel (MENU_PANEL_IDX, view_tree); } /* --------------------------------------------------------------------------------------------- */ @@ -1609,7 +1609,7 @@ panel_tree_cmd (void) void info_cmd (void) { - set_display_type (MENU_PANEL_IDX, view_info); + create_panel (MENU_PANEL_IDX, view_info); } /* --------------------------------------------------------------------------------------------- */ @@ -1619,7 +1619,7 @@ quick_view_cmd (void) { if (PANEL (get_panel_widget (MENU_PANEL_IDX)) == current_panel) change_panel (); - set_display_type (MENU_PANEL_IDX, view_quick); + create_panel (MENU_PANEL_IDX, view_quick); } /* --------------------------------------------------------------------------------------------- */ diff --git a/src/filemanager/layout.c b/src/filemanager/layout.c index c1e0f9373..527d4b202 100644 --- a/src/filemanager/layout.c +++ b/src/filemanager/layout.c @@ -106,7 +106,7 @@ int ok_to_refresh = 1; /*** file scope macro definitions ****************************************************************/ -/* The maximum number of views managed by the set_display_type routine */ +/* The maximum number of views managed by the create_panel routine */ /* Must be at least two (for current and other). Please note that until */ /* Janne gets around this, we will only manage two of them :-) */ #define MAX_VIEWS 2 @@ -971,7 +971,7 @@ get_nth_panel_name (int num) /* since a lot of routines depend on the current_panel variable */ void -set_display_type (int num, panel_view_mode_t type) +create_panel (int num, panel_view_mode_t type) { int x = 0, y = 0, cols = 0, lines = 0; unsigned int the_other = 0; /* Index to the other panel */ diff --git a/src/filemanager/layout.h b/src/filemanager/layout.h index a8658382a..1502d8379 100644 --- a/src/filemanager/layout.h +++ b/src/filemanager/layout.h @@ -62,7 +62,7 @@ void panels_split_more (void); void panels_split_less (void); void destroy_panels (void); void setup_cmdline (void); -void set_display_type (int num, panel_view_mode_t type); +void create_panel (int num, panel_view_mode_t type); void swap_panels (void); panel_view_mode_t get_display_type (int idx); panel_view_mode_t get_current_type (void); diff --git a/src/filemanager/midnight.c b/src/filemanager/midnight.c index e4f773399..fd8f6029e 100644 --- a/src/filemanager/midnight.c +++ b/src/filemanager/midnight.c @@ -661,7 +661,7 @@ create_panels (void) mc_chdir (vpath); vfs_path_free (vpath); } - set_display_type (other_index, other_mode); + create_panel (other_index, other_mode); /* 3. Create active panel */ if (current_dir == NULL) @@ -677,7 +677,7 @@ create_panels (void) mc_chdir (vpath); vfs_path_free (vpath); } - set_display_type (current_index, current_mode); + create_panel (current_index, current_mode); if (startup_left_mode == view_listing) current_panel = left_panel; diff --git a/src/filemanager/panel.c b/src/filemanager/panel.c index 0cd0db5e7..663a9eb62 100644 --- a/src/filemanager/panel.c +++ b/src/filemanager/panel.c @@ -2877,7 +2877,7 @@ chdir_other_panel (WPanel * panel) char *sel_entry = NULL; if (get_other_type () != view_listing) - set_display_type (get_other_index (), view_listing); + create_panel (get_other_index (), view_listing); if (S_ISDIR (entry->st.st_mode) || link_isdir (entry)) new_dir_vpath = vfs_path_append_new (panel->cwd_vpath, entry->fname, (char *) NULL); @@ -2910,7 +2910,7 @@ static void panel_sync_other (const WPanel * panel) { if (get_other_type () != view_listing) - set_display_type (get_other_index (), view_listing); + create_panel (get_other_index (), view_listing); do_panel_cd (other_panel, current_panel->cwd_vpath, cd_exact); diff --git a/src/filemanager/panelize.c b/src/filemanager/panelize.c index a762d7a1b..0564d84c9 100644 --- a/src/filemanager/panelize.c +++ b/src/filemanager/panelize.c @@ -517,7 +517,7 @@ void cd_panelize_cmd (void) { if (!SELECTED_IS_PANEL) - set_display_type (MENU_PANEL_IDX, view_listing); + create_panel (MENU_PANEL_IDX, view_listing); do_panelize_cd (PANEL (get_panel_widget (MENU_PANEL_IDX))); } diff --git a/src/viewer/actions_cmd.c b/src/viewer/actions_cmd.c index 2d4d1030c..fc8151ef2 100644 --- a/src/viewer/actions_cmd.c +++ b/src/viewer/actions_cmd.c @@ -701,11 +701,11 @@ mcview_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void * * panel mode from qick view to another one (by pressing C-x q), the following * occurs: * view hook is deleted from select_file_hook list via following call chain: - * set_display_type (view_listing) -> widget_replace () -> + * create_panel (view_listing) -> widget_replace () -> * send_message (MSG_DESTROY) -> mcview_callback (MSG_DESTROY) -> * delete_hook (&select_file_hook); * @view object is free'd: - * set_display_type (view_listing) -> g_free (old_widget); + * create_panel (view_listing) -> g_free (old_widget); * but @view still is in idle_hook list and tried to be executed: * frontend_dlg_run () -> execute_hooks (idle_hook). * Thus here we have access to free'd @view object. To prevent this, remove view hook